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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Tos
Contributor II
Contributor II

Set Expression formula variable not resolving

Hi,

Set x = "=max(YR)";

Set y = num( round( Sum( {<YR={$(x)}, [fak]={1}>} [price]), 1), '#.##0');

I set these variables in a script. The problem is, when is enter this formula directly in a diagramm it works fine, but if i use the variable $(y) nothing happens. A look to the evaluated formula within Sense shows following:

num( round( Sum( {<YR={=max(YR)}, [fak]={1}>} [price]), 1), '#.##0');

But it should be:

num( round( Sum( {<YR={2019}, [fak]={1}>} [price]), 1), '#.##0');

 

I've already tried serveral combinations which i found in the qlik community, but nothing seems to work.

Does anyone know how to solve this issue? Or do i have to create the formulas with in the variable editor?

 

Thanks

Labels (3)
1 Solution

Accepted Solutions
sunny_talwar

Look at the following threads to see the way to avoid dollar sign expansion in the script

Expression as a variable with $-sign expansion

Stop Dollar Sign Expansion in the script

View solution in original post

2 Replies
sunny_talwar

Look at the following threads to see the way to avoid dollar sign expansion in the script

Expression as a variable with $-sign expansion

Stop Dollar Sign Expansion in the script

Tos
Contributor II
Contributor II
Author

Answer 1:

LET variable = '= only({$<Sales={"' & '$' & '(#=max(Sales))"}>} Town)';

 

Answer 2:

set vTodayString = "~(Today());

set vToday = "=replace([vTodayString],'~','$')";

 

Both answers did it for me.

Thank you.