Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
IMPORTANT: Upcoming LEF Database Maintenance, Oct. 3rd - SEE DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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

1 Solution

Accepted Solutions
Highlighted

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
Highlighted

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

Highlighted
Contributor II
Contributor II

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.