Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
mcsmithums1
Contributor II
Contributor II

Changing the value of a variable in a chart code

Hello! I am currently trying to think of a solution to a problem I have and am open to all suggestions.

I have a variable that I allow the user to set ($(Var)), and it affects visuals in some of my charts. I want some bars to not be affected, (multiplying the total value by the variable amount), if a certain requirement is met . I am currently thinking of changing the value of the variable to 1 inside of the chart code if the requirement is met but I do not know if you can change the value inside of the chart.

If you can change inside, please let me know, if not and you have other suggestions please let me know as well. Thank you.

Labels (1)
1 Reply
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

If I understand your question correctly, you could use a Measure expression like:

=Sum(Sales) * if(Category = 'Fruit', $(Var), 1)

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com