Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Experts,
I've got the following expression in measure in one of my tables:
num(Sum({<AreaContinent={'Canada'} )Total_amount)
I need to store 'Canada' in a variable in the script. I tried SET v.Area=chr(39)&'Canada'&chr(39), but it is not working:
num(Sum({<AreaContinent={$(v.Area)} )Total_amount)
However, the result of calculating $(v.Area) is 'Canada'
Could you please give me a handa. Is it actually possible to do it? Thanks
How about this
Num(Sum({<AreaContinent={$(v.Area)}>} Total_amount))
or
Num(Sum({<AreaContinent={$(=$(v.Area))}>} Total_amount))
How about this
Num(Sum({<AreaContinent={$(v.Area)}>} Total_amount))
or
Num(Sum({<AreaContinent={$(=$(v.Area))}>} Total_amount))
Hi Sunny,
I couldn't make it work. The thing is, if I put the expression in a table I get the result I need 'Canada', but when I use the same variable as a field value in set analysis it isn't working.
Thanks
I can guess that this could be something related to quotes issue or '=' issue in variable declaration. Could you share screenshots of your variable declaration and expression definition and output for the variable?
It turns out that the expression Sum({<AreaContinent={Canada} )Total_amount) also works without the quotes ' * '
I just set a variable in the script:
SET v.Areas='Canada';
Then use it in set analysis:
Sum({<AreaContinente={$(v.Areas)} )Total_amount)