Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
deepakqlikview_123
Specialist
Specialist

If statement vs set analysis


Hello All,

Can you please tell me difference between if statement and set analysis in qlikview.

thanks,

6 Replies
alexandros17
Partner - Champion III
Partner - Champion III

The most important difference is that set analysis is more quick expecially with complex expressions;

When you write a condition this is more compact and easy to read and to change in future

MK_QSL
MVP
MVP

Performance wise set is more efficient than if...

hic
Former Employee
Former Employee

Set analysis is basically building a filter into an aggregation function. The two following expressions should evaluate to the same:

     Sum({$<Product={'X'}>} Amount)

     Sum(If(Product='X', Amount))


Set analysis is always faster. However, Set Analysis is like a selection that is applied before the aggregation. It cannot have different conditions on different lines in the aggregation. In such a case you need an If().


HIC

Not applicable

can you please explain a little bit more on how set analysis is applied before the aggregation and the inhability of having different conditions on different lines? Maybe an example too

qv_testing
Specialist II
Specialist II

The SET expression selection is done once for the whole chart.  SET version would peform must faster.

The IF() evaluates for every row of data.

Basel_Alyafi
Contributor
Contributor

Thanks for the clarification.

What if there are redundant records, would they have the same result too?