Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
vadim_grab
Creator
Creator

if selected field then do expression1 else expression2

Hi, All.

I have a dashboard and filter with list of different analysis periods.

Analysis periods linked with list of expressions, which are using at dashboard like dynamic measure.


I need expression which will show default expression if filter value don't selected, or expression which linked with filter value.


Qlik Sense Desktop 2018-07-24 12.58.01.png

Qlik Sense Desktop 2018-07-24 13.00.18.png


I try with  but without success

=if(GetSelectedCount(description)>0,$($(=PassengerAdultExprFieldCurrent)),$(ePassengerAdultExprFieldMTD))


Many thanks for you comments and advices!

Vadim

5 Replies
tresesco
MVP
MVP

So somehow your second expression (variable expansion) is not working. Could you try putting it separately and see if it is independently working or not? Then, you can start troubleshooting may be the variable declaration.

vadim_grab
Creator
Creator
Author

Hi, Tresesco B

They work excellent in other places, but do not in If statment dashboard...

Vadim

vadim_grab
Creator
Creator
Author

true logic to use GetSelectedCount()?

vadim_grab
Creator
Creator
Author

Maybe very interesting...

Expression don't work:

if(GetSelectedCount(description)>0,$($(=PassengerAdultExprFieldCurrent)),$(ePassengerAdultExprFieldMTD))


Expression work correct:

if(GetSelectedCount(description)=0,$(ePassengerAdultExprFieldMTD), $($(=PassengerAdultExprFieldCurrent)))


Logic is the same, the result is the opposite


Is it bug? Why first expr don't work? second - working correct?

tresesco
MVP
MVP

I came across some posts saying - in QlikSense field selection functions had issues or did not work at certain areas (like, calculated dimension) in some earlier versions. Not sure, if this is something similar or not. I suggest you contact qlik support.