Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have built a Variable with LET:
LET vL.CF= 'sum({<Index_YearWeek={' & '$' & '(=max(Index_YearWeek))}>}Index_CF_Med)';
In the front end (in a textbox) it comes out like the string aboth (without ' and &), so I put a $-sign around my Variable name $(vL.CF) and it computes the correct number. My question is now, what I have to do, that =vL.CF gives me the number already?
Because I thought LET computes the value already, but in this case not?
Thanks for your help.
Chris
Can you check if adding = sign helps?
LET vL.CF = '=sum({<Index_YearWeek={' & '$' & '(=max(Index_YearWeek))}>}Index_CF_Med)';
Can you check if adding = sign helps?
LET vL.CF = '=sum({<Index_YearWeek={' & '$' & '(=max(Index_YearWeek))}>}Index_CF_Med)';
LET will evaluate your expression and assign the result to the variable.
But your expression is not returning an aggregate (i.e. evaluating the sum() function), but a concatenated string literal.
Besides this, you can't evaluate your aggregation in the script (no set analysis in script) and you can only use aggregation functions in a table LOAD (again, you can of course create a literal that contains the aggregation function as text, like you did).
Hope this clarified the use of LET here.
To answer if you need to add the equal sign or not, is another topic, and it will be dependent on the context you want to finally use your variable in.
So there is no way to compute the result in the script, as you say?
Thank you very much for your effort!
Not using set analysis and not considering user selections (which will influence 'max week').
If you are fine with static aggregates, that doesn't recompute when the user makes selections, you can precalculate them in the script (using table loads, group by clause and aggregation functions).