Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
If i have a variable called vFoo. Can we filter this variable directly in set analysis?
Something like:
Sum({$<$(vFoo) = {"<10"}>}Sales)
No, but an variable has single value therefore you could use an if statement.
IF($(vFoo) = <10, Sum(Sales),0)
You can do this - but it is important that the vFoo will evaluate to something that is relevant and contains a field:
Sum( { <UniqueRowId={"=($(vFoo))<10"}> } Sales)
So the expression =$(vFoo)<10 should evaluate to a boolean result that determines which rows that would be included in the sum. If vFoo evaluates to a constant then the sum would be zero or if not the sum of all rows.
The field on the left hand side does not necessarily need to be a UniqueRowId but I find it easier to understand it and get it to work by having that as the field. If you have a non-unique row id as field means that the expression on the right hand side MUST have aggregation functions just like you would use in a "group by" in a SQL statement or LOAD statement.