Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Chanty4u
MVP
MVP

Multi selections

Hi all,

i need small help  , i am caluclating the YOY growth in stright table  so i have a list box with values like 2017Q1 to 2018Q3   so the expression which i used is working fine with single selection but  when i tried to select multiple values the result is showing null   ... how to avoid this ?  below is my expresion

HW YoY Growth : =IF(Quarter = vNewMaxQtr,(($(vHWFCYOYServ)- $(vHWRevYOYServ)) / $(vHWRevYOYServ)), (($(vHWACTYOYServ)-$(vHWRevYOYServ)) / $(vHWRevYOYServ))

 

Current Quarter:    HW Forecast / HW Revenue

**********************************************************************************************************************************************************************************

vHWFCYOYServ = if(max(Dimensionality())=1, 

sum({$<Quarter={$(vCurQtr)},Service_PL={'HWR'},Type={'HW Forecast SR'}>}Service_Amount),

if(max(Dimensionality())=2, 

sum({$<Quarter={$(vCurQtr)},Service_PL={'HWR'},Type={'HW Forecast SSR'}>}Service_Amount),

if((Dimensionality())=0,

sum({$<Quarter={$(vCurQtr)},Service_PL={'HWR'},Type={'HW Forecast SR'},Sub_Region=>}Service_Amount)+sum

({$<Quarter={$(vCurQtr)},Service_PL={'HWR'},Type={'HW Forecast SSR'},sub_sub_region=>}Service_Amount)))) 

 

vHWRevYOYServ = Sum({$<Quarter={$(vPrevQtr)},Type={'HW Actuals'}>}Hardware_Revenue_Amt) 




can anyone have idea please help on this?


thanks

Chanty

14 Replies
YoussefBelloum
Champion
Champion

I recommend to add Distinct inside Concat() to be sure to have unique values in case you select multiple values..

Chanty4u
MVP
MVP
Author

you mean this?

or where i need to have the distinct?

vCurQtr: =chr(39)&concat(distinct Quarter,chr(39)&','&chr(39))& chr(39)

and

vPrevQtr: =chr(39)&concat(distinct(Left(Quarter,4)-1)&Right(Quarter,2),chr(39)&','&chr(39)) & chr(39)

YoussefBelloum
Champion
Champion

wherever you need to use concat to be able to put multiple values inside set analysis for example

No need to have duplicated values (it can cause problems)

So on both expression (don't know which one will work).

Chanty4u
MVP
MVP
Author

Thanks Youssef.  first let me validate with the data  if i got anything wrong will try as you suggested.

Anil_Babu_Samineni

That' fine - Please close this thread

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)