Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear all,
I have a set expression that will need to be modified depending on whether the user has applied a filter on a specific dimension in my app. The expression looks as follows, where vValue should assume the value of 1 or otherwise be "disabled" depending on whether the user has made a selection on the dimension TerritoryID:
Sum ( {$<MyVariable = vValue>} Sales )
The expression should be evaluated as follows:
If GetSelectedCount(TerritoryID) > 0, then
Sum ( {$<MyVariable = {1}>} Sales )
Otherwise
Sum ( {$<MyVariable = >} Sales )
Combining the above in one If...Then statement will not work for my purposes.
/ Andreas
Create a new variable, preferably in the script like this:
Set vChooseMyVariable = =if (GetSelectedCount(TerritoryID) > 0, '{1}', '');
Note there are two "=" in the above.
Then your expression will be:
Sum ( {$<MyVariable = $(vChooseMyVariable)>} Sales )
-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com
Thanks - works well.
/ Andreas