Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
varunreddy
Creator III
Creator III

If statement in bar chart dimension

Hi All,

 

I have 3 buttons and this will change the value of the variable(vTest) when selected.

I am trying to create the bar chart with 2 dimensions. One of the dimension is the calculated value based on the button selection.

I am using the below expression but I am getting blank value in the second dimension. Does it need any change for the expression to work? 

if(vTest=1, A,

if(vTest=2,B,

if(vTest=3,C

)))

 

Thanks in advance!

7 Replies
JordyWegman
Partner - Master
Partner - Master

Hi Varun,

What happens when you put your variable in a text box $(vTest) and click on the button. Does it change to two? I think your problem lies in there.

Jordy

Climber

Work smarter, not harder
varunreddy
Creator III
Creator III
Author

Hi Jordy,

 

It is working if I try to display text instead of the value.

i.e. if(vTest=1, 'A') - This is working and displaying A. When I try to display value for A it is not.

JordyWegman
Partner - Master
Partner - Master

Get a text box, and put in the textbox '$(vTest)'. What does it say?

Jordy

Climber

Work smarter, not harder
varunreddy
Creator III
Creator III
Author

It is giving me values 1, and 3 respectively based on the button selection.

 

Cheers,

Varun

JordyWegman
Partner - Master
Partner - Master

Why isn't it giving number 2? If that is working, you can use your formula for the bar chart as a dimension.

Jordy

Climber

Work smarter, not harder
varunreddy
Creator III
Creator III
Author

Sorry I missed it. It is giving me 1,2 and 3. It is not working when I try to display values from the field A.

JordyWegman
Partner - Master
Partner - Master

Can you show the formula in the bar chart?

Work smarter, not harder