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: 
carolin01
Luminary Alumni
Luminary Alumni

Variable

Hello together,

I´ve a short question: In a chart I´m trying to let appear an expression conditionally:

= GetSelectedCount ({$(vChooseYear1)}) = {$(vCurrentFY)}

I would like to show the expression only if the Variable vChooseYear1 is equal to the Variable vCurrentFY.

I´m still strugling to understand when it has to be done how. Could anybody help me to correct this function?

Many thanks for your help!

Best regards,

Carolin

1 Solution

Accepted Solutions
Not applicable

Hi Carolin:

this should really work: (i do not use any quotes)

=GetSelectedCount($(vChooseYear1))=$(vCurrentFY)

(and no if() as it is in a "show conditional" - expression)

RR

View solution in original post

10 Replies
gandalfgray
Specialist II
Specialist II

I think you can just use:

Variable1=Variable2

conditional.JPG.jpg

works for me, at least 

nilesh_gangurde
Partner - Specialist
Partner - Specialist

Try this.

if(GetSelectedCount ('$(vChooseYear1)' = '$(vCurrentFY)') = 1,1,0)

-Nilesh

Not applicable

Hi Carolin:

this should really work: (i do not use any quotes)

=GetSelectedCount($(vChooseYear1))=$(vCurrentFY)

(and no if() as it is in a "show conditional" - expression)

RR

Not applicable

Enable the condition check box..

gandalfgray
Specialist II
Specialist II

I don't see why you should use GetSelectedCount to compare two variables?

If vChooseYear and vCurrentFY is two variables as Carolin states, a simple comparison like I suggested will do.

Regards/GG

carolin01
Luminary Alumni
Luminary Alumni
Author

This worked, too - thank you 🙂

carolin01
Luminary Alumni
Luminary Alumni
Author

Thank you, this worked. 🙂

Not applicable

Hi GG,

I assume in vChooseYear is the fieldname (Year?). And in vCurrentFY is the number of selected items of this field.

May be (for example) she wants to show a specific chart only when NumberOfSelectedYears = 1.

HtH

Roland

carolin01
Luminary Alumni
Luminary Alumni
Author

Hi,

the reason why I was trying to do this is that we have created a sales plan for the current fiscal year. This is shown in a chart where you can choose two different years and compare them. Therefore I created two variables:

vChooseYear1 and vChooseYear2. As we have created the sales plan only for the current fiscal year it does not make sense to show it if you compare 2012 against 2013. Therefore I wanted to show the expression to show the sales plan only if the variable vChooseYear1 = vCurrentFY (=current fiscal year).

I appreciate very much the quick help of you both. Both solutions are working here 🙂

Best regards

Carolin