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

Problem in reusing expressions

Hi,

In order to re-use expression (so i can use it in different charts without typing the expression again), i use LET in the script, and then the $() in the chart.

Nevertheless, when there is a string comparison in the expression (see below the PricingModel=CPC) the expression is not valid.

LET vRevenue = 'Sum(if(PricingModel=CPC,cost))';

how can i cause this expression to be valid?

Just to clear it up, when i use the expression Sum(if(PricingModel='CPC',cost)) directly in the chart it is working fine.

thanks,

Guy

12 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi Sajeevan,

     Yes now it will work.Its like assigning a string value to a variable.

Celambarasan

Not applicable
Author

Sajeevan Govindan

I think the expression ='Sum({<PricingModel={"CPC"}>} cost)' works becuase you use SET ANALYSIS in the expression, otherwise is not.

Thanks a lot for all opf you!

Not applicable
Author

Yes, you are right.