Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

reuse of expression in a long if then statement

hi, is it possible to improve this very very long if statement? (see attached)

basically it would be great if I can calculate $(eCharge) only once but what happens it is calculated 90 times in that if then. I have to use it in a chart though so I cannot use dollar expansion - it should respect chart dimensions.

$(eCharge) expanded to SUM( {complex set analysis exp here} [Charge Amount])

1 Solution

Accepted Solutions
Clever_Anjos
Employee
Employee

If you´re using a straight table

1) Create na expression. using $(echarge), get the index of your column and mark it to now show

2) Modify your expression. to use column(yourindexhere)

View solution in original post

4 Replies
sudeepkm
Specialist III
Specialist III

using such a lengthy IF ELSE may have negative impact on your UI. Can you please see if you can handle couple of evaluations at a script level or use Dollar Expansion expressions.

Anonymous
Not applicable
Author

unfortunately this has to be calculated on the fly since it should respect user selections. No, I cannot sue dollar expansion on the whole expression because expressions are expanded BEFORE chart is calculated hence expression would not respect dimensions in a chart.

Clever_Anjos
Employee
Employee

If you´re using a straight table

1) Create na expression. using $(echarge), get the index of your column and mark it to now show

2) Modify your expression. to use column(yourindexhere)

Anonymous
Not applicable
Author

this is much faster, you are Clever indeed thanks a lot!