Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
Is it possible use set analysis with function Variable.
Other words,
vVar1=sum(Variable)
in expression: sum({<Variable2={'...'}>} vVar1)
Thanks,
You're right, you can't pass set analysis into a variable while evaluating the variable as an expression because the expression $(myVar) is already an evaluation. But the solution above should work just as well.
Regards,
Vlad
Hello Vladimir,
You can indeed. Just make sure that your variable holds the expression without a '=' if you are defining it in Settings-Variable Overview and inside single quotes if you define in the loading script.
vVar1='sum(Variable)';
You then refer to it in your expression in the following manner.
sum({<Variable2={'...'}>} $(vVar1))
George
If I understand you correctly, you're asking if it's possible to separately store the expression variable and the set analysis variable. Indeed it is, and it makes life a lot easier in terms of management. However, you can only assign a field value in set analysis, not a variable value. So something like this:
vVar1 (make sure this does not start with an = sign)
sum($(vVar2) myfield)
vVar2 (make sure this does start with an = sign)
='{<' & 'myfilter={' & chr(39) & 'ABC' & chr(39) & '}>}'
Expression
$(vVar1)
Hope this helps,
Vlad
Hi Vlad,
Thank for your help.
I have expression like this
myVar:
Round ((Count({<[Overall experience]={'9-10'}>}[Overall experience])-Count({<[Overall experience]={'0-6'}>}[Overall experience]))/
count(TOTAL [Overall experience]),0.001)*100
I want to use it depended on variable-Country.
round(SET ANALYSIS Country) myVar)
I think conditional and myVar don`t work together.
Am I right
Regards,
How about something like this:
Round ((Count({<[Overall experience]={'9-10'},Country={$(vCountry)}>}[Overall experience])-Count({<[Overall experience]={'0-6'},Country={$(vCountry)}>}[Overall experience]))/
count({<Country={$(vCountry)}>}TOTAL [Overall experience]),0.001)*100
This assumes that your field is called Country and your variable that contains the relevant country is called vCountry.
Vlad
It should work.
the question was possible to use Variable and SET ANALYSIS.
I think it doesnt work
Thanks,
You're right, you can't pass set analysis into a variable while evaluating the variable as an expression because the expression $(myVar) is already an evaluation. But the solution above should work just as well.
Regards,
Vlad
Thank you for confirmation