Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I'm trying to inject a variable into a Master Item depending on selections.
Ideally if no selection is made then the Master Item would be something like:
Sum({< Product = {'Shoes'} >} Sales)
But should a certain selection is made then ideally the Master Item would look like:
Sum({< Product = {'Shoes'} & '$(vVar)' >} Sales)
The variable would look like :
vVar = ' ,Country = {'England'}'
This is wanted to avoid creating a number of master items which are identical except for one filter difference. So when nothing is selection the vVar would be null.
You may apply:
vVar: = if(getselectedcount(YourField), ' ,Country = {'England'}', '');
Sum({< Product = {'Shoes'} & $(vVar) >} Sales)
@marcus thanks for your reply. This got me most of the way there . In the master item I had to remove the & for it to work:
Sum({< Product = {'Shoes'} $(vVar) >} Sales)
The variable I had to add Chr(39) to get the ' to show:
vVar = If(getselectedcount(YourField),',Country = {' & chr(39) & 'England' & chr(39) & '}', '')