Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator III
Creator III

Performance Impact of Set Analysis vs Calculated Dimension

Hi All,

 

I have a line chart with Dimension 

If(Date > '7/15/2018',Date)

and measure Sum(Sales)

I am wondering what is more optimal performance wise using my calculated dimension or using set analysis 

Sum({<[Date] = {'>7/15/2018'}>}Sales)

 

I know the best thing to do would be create a flag in my script for Date > 7/15 and use that in my Set Analysis but its not always feasible to have so many flags.  

Thanks!

Mark

Labels (2)
1 Solution

Accepted Solutions
Highlighted
Partner
Partner

simply put it goes through each line of the data to evaluate your if condition.
while set analysis evaluates the set once per visualization (then again when filters are applied)

check these
https://community.qlik.com/t5/Qlik-Design-Blog/Why-is-it-called-Set-Analysis/ba-p/1468208
https://community.qlik.com/t5/Qlik-Design-Blog/A-Primer-on-Set-Analysis/ba-p/1468344

View solution in original post

4 Replies
Highlighted
Partner
Partner

Set analysis is vast majority of times always faster than if statements.
the reason is that your if statement gets calculated for each line which means it doesn't get cached.
while set analysis gets calculated once.

Possible exceptions are really complex aggr within the set.
Fastest ofcourse is flags. but as you say not always possible and not the most flexible
Highlighted

Between the two, I would say Set analysis is always a better option.
Highlighted
Creator III
Creator III

Thank you for your response.  Could you explain further what you mean by

'the reason is that your if statement gets calculated for each line which means it doesn't get cached.
while set analysis gets calculated once.'

Highlighted
Partner
Partner

simply put it goes through each line of the data to evaluate your if condition.
while set analysis evaluates the set once per visualization (then again when filters are applied)

check these
https://community.qlik.com/t5/Qlik-Design-Blog/Why-is-it-called-Set-Analysis/ba-p/1468208
https://community.qlik.com/t5/Qlik-Design-Blog/A-Primer-on-Set-Analysis/ba-p/1468344

View solution in original post