Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I would like to understand the use of $ symbol on expressions like this:
Sum({<Year={2022}>}Sales)
Sum({$<Year={2022}>}Sales)
I understand that $ is used to evaluate the expression in front of it, but in these cases I don't seem to see the difference.
Thanks for the help!
The $ is the default state, it means all sales in the current selection that belong to the year 2022.
If there is nothing in front of the <, in the background it still uses the $
In most cases there is no difference. But there are cases where the difference is big...
The set expression is usually like {$<SetModifier>}. That means that it takes the current selection of the default state ($) and modifies this using the SetModifier.
But if you instead have {<SetModifier>} then it takes the context and modifies this. The "context" is whatever state or set expression you have "outside" the set expression.
Example 1: You have an object that belongs to an alternate state. Then the current selection of this state is the context.
Example 2: You have a set expression inside an aggregation function inside an Aggr() with a set expression, e.g. Sum(Aggr({$<...>} Count({...} X),Dim)). Then the context for the inner set expression is the set expression in the Aggr().
Example 3: It is now possible to have a set expression for the entire object, the qContextSet. This is the context for all aggregation functions inside the object.
The $ is the default state, it means all sales in the current selection that belong to the year 2022.
If there is nothing in front of the <, in the background it still uses the $
in simple words i think writing {$} before/in expression will make it change with filter while using{1} will fix it even when some filter is applied outside.