Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Krish
Contributor III
Contributor III

adding conditions to Variables in Set Command

Hi,

I am trying to re-use a formula which is used in multiple places in dashboard. I am trying to create a variable which is common across all the places like

sum({<payment={'cash'}>}sales) and create it as a variable vsales = sum({<payment={'cash'}>}sales),

Now I want to add a condition like country='IND' for one chart and country='usa' for other chart, but the calculation is same. 

sum({<payment={'cash'},country={'IND'}>}sales) & sum({<payment={'cash'},country={'AUS'}>}sales)

How can I create a variable with common features and re-use them by adding the additional condition based on requirement.

Labels (2)
1 Reply
QFabian
Specialist III
Specialist III

Hi @Krish , one option could be use alternate states inside the expressions.

So you can have the same field Country, more than one, but each one referencing to a different State

QFabian_1-1611159676218.png

Please check the qvw

 

 

QFabian