Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Qlikview user
I have a button which I would like the user to be able to click on, and each time they click on the button the wording would say either:
'Compared to Previous FY YTD:' OR
'Compared to Previous Month'
I have the following expression
=If(v_Selected = 1,
'Compared to Previous FY YTD:',
If(v_Selected = 2,
'Compared to Previous Month'))
and 2 actions on the button where set variable = v_Selected = 1 and
set variable = v_Selected =2
But unfortunately my button isn't working
I am trying to stay away from show/hide and the number of objects within my document, so was wondering if anyone could help me obtain this result with just one button object instead
Any help would be greatly appreciated
Thanks
Helen
Set you variable like this
v_Selected
Definition
=If(v_Selected = 1, 2, 1)
The variable will not toggle between 1 and 2 every time you click on the button. Now you can set your expression/dimension with values of 1 and 2.
You are setting the same variable 2 values? I think if you select the button, it will only be saved with one value. What exactly is your goal here?
Hello SunnyT
Thanks for your response
I have a table which shows data by Financial Year. I now want to show the same table but by data by Previous Month
I would like just one button which if the user clicks on it, then they will either see data by Financial Year or by clicking again, data by Previous Month
My aim is to have one graph and one button to control whether the user views data by Financial Year or Previous Month
My aim is to reduce the number of objects by 1/2 using this technique
Any help would be greatly appreciated
Kind Regards
Helen
Set you variable like this
v_Selected
Definition
=If(v_Selected = 1, 2, 1)
The variable will not toggle between 1 and 2 every time you click on the button. Now you can set your expression/dimension with values of 1 and 2.
Don't use button for this:
Use Inline Tables:
You can get a List Box as Below and Now you can use GetFieldSelection(CTP) function in your Conditional Box
Perfect!
Thanks so much! I have done this before in other things and didn't think to use the same technique here aswell
Thank you!
Thanks
Helen
Not a problem, I am glad I was able to help
Best,
Sunny
I'd suggest replacing the 1/2 values with 1/0 values and use a single Actions: Set Variable:
vSelected = 1-vSelected
That will create the flip-flop action that you are looking for,
cheers,
Oleg Troyansky
Learn advanced QlikView and Qlik Sense techniques in my book QlikView Your Business.
Hi Helen,
for the button text:
=if(v_Selected=1,'Compared to Previous FY YTD','Compared to Previous Month')
HTH
Andy