Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hello All,
I have lot of expressions in my document which have similar pattern in the set analysis, although the measures differ.
='$'&NUM(ROUND(SUM({<name={'Baby Products'}>}sales)),'##,###,###,###')
this and similar expressions where the 'Baby Products' changes as needed.
Question 1: Is there a way I can put the whole expression in variable for reusability and pass the 'Baby Products' or other value as parameter?
Question 2: I tried putting atleast the "name={'Baby Products'}" in a variable and called vSetFilter and use the expression '$'&NUM(ROUND(SUM({<$(=vSetFilter)>}sales)),'##,###,###,###') but it does not work.
Thanks
Raghu
Attached is a sample QVW incase you need it.
Thanks
Raghu
Hi,
you can try with:
='$'&NUM(ROUND(SUM({<name={$(vSetFilter)}>}sales)),'##,###,###,###')
where
vSetFilter = 'Baby Products'
Hope it helps
regards
Giampiero
Hi Giampiero,
That does not solve the problem of reusability much. I am just replacing 'Baby Products' with $(vSetFilter).
What I wish to do it to make the whole expression as a variable, and then maybe pass another variable like vSetFilter = 'Baby Products' or vSetFilter="name={'Baby Products'}" as a parameter.
Not sure if I am able to explain correctly, but let me know if you have more questions please
Thanks
Raghu
Hi Raghu,
I understand your problem.
Just a question, how do you want to change the var. value?
Do you want to use an input box or other?
I try to think about your problem.
Regards
Giampiero
Hi Giampiero,
The way I want to use this is:
Whenver I need an expression, I can use the expression variable and then pass on or concatenate the setFilter variable into the overall expression to get the correct filtering of my data.
Thanks
raghu
Have you tried using quotes??
'$'&NUM(ROUND(SUM({<'$(=vSetFilter)'>}sales)),'##,###,###,###')
'$'&NUM(ROUND(SUM({<"$(=vSetFilter)">}sales)),'##,###,###,###')
This does not work. Incorrect Syntax error.
You can try it in the test QVW I attached above.
Thanks
Raghu
Hi Raghu,
see attach file.
See the variables.
Hope it helps
Regards
Giampiero