Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Action-Packed Learning Awaits! QlikWorld 2023. April 17 - 20 in Las Vegas: REGISTER NOW
Showing results for 
Search instead for 
Did you mean: 
Not applicable

condition inside expression

Hello Qlik Community,

What is the most efficient - speed wise - way of doing row level conditions in expressions in a chart?

The only way I know of currently is to have the condition inside an if statement in the expression. 




( sum(other_stuff) / count(even_more_stuff) ) * count(never_ending_stuff)



As I understand it, the if will calculate all conditions before presentation - so storing in a variable is something I have been testing, but not seeing huge performance gains.



5 Replies
Not applicable


I think, there is no way to avoid calculations of unused branches of IF or PICK - these parameters fully calculate at moment of function call, before main condition selection. And placing a part of expression in a variable is not helps.

But, if you have no dimensions (for example, in text box), you can use $-expanding for text of expressions (instead on expressions itself). So, after expanding only one text of IF executes:

=$(=If(True(), '2+2', '3+3'))       // In this example, expression '3+3' never evaluates.

But $-expanding is not dynamic and is calculated in chart only once. So, if you have any dimension, the IF condition is calculated only once, not for each dimension value (like TOTAL clause works).

Luminary Alumni
Luminary Alumni


Try this expression


Try this expression

= sum({<other_stuff={'=count(stuff)>=10'}>}other_stuff) / count({<even_more_stuff={'=count(stuff)>=10'}>}even_more_stuff) ) * count({<never_ending_stuff={'=count(stuff)>=10'}>}never_ending_stuff)



Not applicable

Thanks for the reply, I am having an interesting result with this approach.  Within the pivot chart every record takes the value of the what would be correct for only the first record for the column with the condition applied.


I think Andrei pointed out that you can't use the =$() technique if you have chart dimensions. If you did use that technique, getting the same value on every row would be expected.

To answer your initial question, I don't think there is anything more efficient than if() for doing row level conditions.


Not applicable

ah, thanks Rob