Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Performance - Set Analysis vs IF Statements

Hi Experts,

I have a huge reference application that has dashboards for pretty much all areas of our organization. I use this as a validation app to cross check numbers with other apps before releasing. This is one of the first app that I built and used if conditions in the expressions though out. It has 20+ sheets and have many charts in each sheet with multiple expression. Obiviously , the performance is terrible. I was thinking of replacing all the "if statements" with "set analysis".

So my question is , Is it worh spend time converting to "Set Analysis"? Does it improve performance significantly?

Example

Form :

sum(if( ORD_STATUS = 'Complete' AND Approval ='Y' AND Type = 'Web Sales',(if(InYear(ORDER_DATE, (today()),-1), AMT)),0))

To:

sum({$<ORD_STATUS = {'Complete'}, Approval = {'Y'} ,Type = {'Web Sales'}, ORD_YR= {"$(=num(Year(Today(0))-1))"}, >}AMT)

Thanks,

Aji Paul.

4 Replies
Gysbert_Wassenaar

It should improve performance. But significantly? Probably not since it's only one expression in one object. You can try to do some analysis to see which objects take a lot of memory and/or time. See for example this blog post: Recipe for a Memory Statistics analysis. Or the Document Analyzer application.


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

In addition, the expressions with SET are not "cacheable".  That means, they will be calculated every time.

Besides, it not always possible to use SET expressions in chart because the set is evaluated aginst all data, not per chart dimensions.

Regards,

Michael

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

My guess is that the SET version would peform must faster. The SET selection is done once for the whole chart. The IF() evaluates for every row of data.

-Rob

Not applicable
Author

Rob ,

Is there any way you could incorporate the expression CPU toll to your document analyzer ?

Thanks,

Aji Paul.