Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Swethareddy
Contributor
Contributor

Passing Measure dynamically to bar chart in Qlik

I have  a requirement to change measures in a bar chart and i achieved it using parameters and calculations in tableau.

similarly i am doing it using variables in Qlik took variable a and variable b given definition for them .

now i can  call them in a table and is working but i now need a drop down to switch measures  in bar chart .For that i used variable input control but not able to clearly understand how to use it to get similar functionality in tableau. And how to use in bar 

Swethareddy_1-1637919724759.png

 

Swethareddy_0-1637919702122.png

 

2 Replies
AshutoshBhumkar
Partner - Specialist
Partner - Specialist

Hello,

You can use Pick() function to select measures according to the selection of measures.

E.g 

You can use Variable input to store a variable value for each measure.

like Sales =1, Budget=2.

Use measure like 

Pick(vVariable,

Sum(Sales),

Sum(Budget))

 

Measure will pick expression according to the variable value.

 

Thanks,

Ashutosh

 

 

 

brunobertels
Master
Master

Hi

you have created 2 variables ,let's say Vmesure1 and Vmesure2 

create a third variable , name it Vdropdown and give it for exemple 1 as value ( 1 will serve for the default mesure between Vmesure1 and Vmesure2 ) 

now using variable button in a sheet : 

Name : select in the list Vdropdown

show as : drop down 

 

Value = Fixed 

clic on add alternative 

label : name it " Mesure1"

Value = 1 

clic on add alternative 

label : name it " Mesure2"

Value = 2 

 

You may have a drop down with Mesure1 and Mesure2 

In your graph now add this as mesure 

=if($(Vdropdown )=1,$(vMesure1), if($(Vdropdown )=2,$(vMesure2)))

use the same approach for titles to provide dynamic label depending of the choice made in the drop down list

 

Hope it helps 

Bruno