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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
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

Labels (1)
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

Hו 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.