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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Ignoring fields by IF

Hi all,

over the time my QlikView application became a bit slow. I mainly use simple expressions like "Sum(Revenue)". (In performance tests I already sorted out the more complex expressions)

The sluggish performance is only disturbing, if in ONE certain field (valuetype) no selection is made.
So I thought about a simple solution to calculate the Sum only if a selection is made.

=if(GetSelectedCount(valuetype)=0,0,Sum(Revenue))

This works in terms of returning 0 in case no selection is made, but the (bad) performance is as it was before.
The idea is to calculate the Sums only if a selection is made for valuetype, otherwise just return 0 ("do not even touch the Sum formula"). I thought this should be faster than any Sum(if(a=b,myfield)) or Sum({a=b}myfield) approach, where the Sum-function must at least do 'something'.
But it is not ....

Any thoughts on this?
Thank you,

Thilo

2 Replies
Not applicable
Author

If it is okay to display the chart only when some selections are made, then you could try this:

In the chart properties, you can put calculation condition "getselectedcount(valuetype) > 0". This will show the chart only when some selection is made else will display a message which can be customized (Properties/General/Error Messages).

Thanks

Amit

Not applicable
Author

Hello Amit,

yes - I can imagine this as a workaround.

But still I'd like to understand QlikView in more detail.

In case of a formula like "if (condition, expression1, expression2)" ... when is 'expression2' processed?
I would expect that this is done only in case of 'condition = false'.
Does QlikView work this way?

Thank you,
Thilo