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: 
Not applicable

IF Statement Performance at dashboard level

Hi All,

Have a query on if statements been used at dashboard level.  Will using of IF statement, be it at expression or customised dimension.

How will it affect the performance?

Because I have 5 dimensions been customised using IF statements.  And this is repeated in all my reports where the data is not huge yet.  In the long run when the data grows, it is advisable to do this ?  Or is there any alternative beside using IF statements.

Does it matter if IF statement is been used at expression level OR dimension level regarding performance issue?

Example:

1. IF(EvaluationType ='ABC',True,False)

2. IF(Data Type='DDD',1,0)

Can someone please advise on this approach and suggest better ways to improve.  I know PICK is one of them but sometime is not viable in my expression.

Thanks

Chun Wey

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

Always try to avoid Calculated dimension in charts, if possible try to bring a new column in the script itself like below

LOAD
*,

IF(EvaluationType ='ABC',True,False) AS EvaluationTypeNew,

IF(Data Type='DDD',1,0) AS DataTypeNew

FROM DAtaSource;


Now you can use this fields directly as dimensions, this improves the performance and standardizes the code.  If there is a change in logic you can just change in one place i.e,. script.  Also it is for mainenance.


Hope this helps you.


Regards,

Jagan.


View solution in original post

4 Replies
Anonymous
Not applicable
Author

I always avoid Calculated Dimension where possible and do the calculation in the load script.  Calculated Dimensions are resource hungry in the GUI.

Expressions most often have to calculated on the fly, but if I can pre-calculate in the load then I do.  Also in expressions I prefer Set Analysis to IF statements.

Not applicable
Author

Hi Bill,

thanks for your advice.

At least this will make my approach in doing Qlikview more efficient and align to best practice.

Thanks

Chun Wey

jagan
Luminary Alumni
Luminary Alumni

Hi,

Always try to avoid Calculated dimension in charts, if possible try to bring a new column in the script itself like below

LOAD
*,

IF(EvaluationType ='ABC',True,False) AS EvaluationTypeNew,

IF(Data Type='DDD',1,0) AS DataTypeNew

FROM DAtaSource;


Now you can use this fields directly as dimensions, this improves the performance and standardizes the code.  If there is a change in logic you can just change in one place i.e,. script.  Also it is for mainenance.


Hope this helps you.


Regards,

Jagan.


Not applicable
Author

Hi Jagan,

Yes, it do helps!

Thanks for your example in illustrating this.

Rdgs,

Chun Wey