Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Sa_Rah
Contributor III
Contributor III

GetSelectedCount() not working with IF function on dimension

I am using the following formula to identify whether or not to display some visualizations. I shall call it Formula 1:

((GetSelectedCount(DateLinkDate) + GetSelectedCount(LinkDate) + GetSelectedCount(YearLinkDate) + GetSelectedCount(MonthYearLinkDate) + GetSelectedCount(FinYearLinkDate)) > 0)

 

This is working fine if I select specific values of one of the mentioned dimensions e.g. FinYearLinkDate.

 

However if i have an IF() statement around say FinYearLinkDate  in another visualization, e.g.

=if(MonthYearLinkDate>'31/03/2019',if(MonthYearLinkDate <=MonthEnd(Addmonths(today(),-1)),FinYearLinkDate))

and I use this visualization to select the FinYearLinkDate, Formula 1 evaluates to 0 and no visualization displays.

 

Does anyone know why this is happening? 

 

Thanks

 

Sarah

Labels (1)
1 Solution

Accepted Solutions
sasikanth
Master
Master

HI, 

Try below,

Since there is no dependency , move your calculated Dim Exp to script as a New filed and use it in fist expression. 

if(MonthYearLinkDate>'31/03/2019' and MonthYearLinkDate <=MonthEnd(Addmonths(today(),-1)) ,FinYearLinkDate) As NewMonthYearLinkDate,

 

((GetSelectedCount(DateLinkDate) + GetSelectedCount(LinkDate) + GetSelectedCount(YearLinkDate) + GetSelectedCount(MonthYearLinkDate) + GetSelectedCount(NewMonthYearLinkDate)+GetSelectedCount(FinYearLinkDate)) > 0)

 

Thanks, 

Sasi

 

 

 

View solution in original post

1 Reply
sasikanth
Master
Master

HI, 

Try below,

Since there is no dependency , move your calculated Dim Exp to script as a New filed and use it in fist expression. 

if(MonthYearLinkDate>'31/03/2019' and MonthYearLinkDate <=MonthEnd(Addmonths(today(),-1)) ,FinYearLinkDate) As NewMonthYearLinkDate,

 

((GetSelectedCount(DateLinkDate) + GetSelectedCount(LinkDate) + GetSelectedCount(YearLinkDate) + GetSelectedCount(MonthYearLinkDate) + GetSelectedCount(NewMonthYearLinkDate)+GetSelectedCount(FinYearLinkDate)) > 0)

 

Thanks, 

Sasi