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: 
m_perreault
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
dplr-rn
Partner - Master III
Partner - Master III

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
dplr-rn
Partner - Master III
Partner - Master III

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
sunny_talwar

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

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.'

dplr-rn
Partner - Master III
Partner - Master III

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