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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
300sss300
Creator
Creator

Conditional expression Query

HI,

In retail performance executive dashboard the following conditions have been used in Top Store by Sales table:

Expressions:

1. Sales (conditional) vTop=1

2. Fresh Food Sales  vTop=2

3. Customer Satis vTop=3

and in icon the following values have been assigned to the variable vTop

=if(vTop<3, $(vTop)+1, $(vTop)-2)

just wanna understand and learn 2 things:

a) what is the meaning of saying if vTop<3 then vTop+1 else vTop-2 could not understand +1 and -2 if anyone please explain in detail.

b) what if we have another expression with condition vTop=4 then what will be value for variable vTop in action section.

 

Best Regards,

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

The expression causes the variable to cycle 1, 2, 3, 1, 2, 3... as the action is triggered.


For 4 values
=if(vTop < 4, vTop + 1, vTop - 3)


Or use Mod:
=Mod(vTop, 4) + 1

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

2 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

The expression causes the variable to cycle 1, 2, 3, 1, 2, 3... as the action is triggered.


For 4 values
=if(vTop < 4, vTop + 1, vTop - 3)


Or use Mod:
=Mod(vTop, 4) + 1

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
300sss300
Creator
Creator
Author

Thanks!

Perfect explanation and solution.