Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
Can you please tell me difference between if statement and set analysis in qlikview.
thanks,
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
Performance wise set is more efficient than if...
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
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
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.
Thanks for the clarification.
What if there are redundant records, would they have the same result too?