# Qlik Sense App Development

Highlighted
Contributor II

## 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)

• ### Set Analysis

1 Solution

Accepted Solutions
Valued Contributor III

## Re: Performance Impact of Set Analysis vs Calculated Dimension

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
4 Replies
Valued Contributor III

## Re: Performance Impact of Set Analysis vs Calculated Dimension

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
MVP

## Re: Performance Impact of Set Analysis vs Calculated Dimension

Between the two, I would say Set analysis is always a better option.
Contributor II

## Re: Performance Impact of Set Analysis vs Calculated Dimension

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

Valued Contributor III

## Re: Performance Impact of Set Analysis vs Calculated Dimension

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