Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
how are you?
I am struggling to understand the following expression:
=if(
Aggr(Sum(1), Country)>0,
'Selected: $(=Concat(DISTINCT Country, ', '))',
'Others: $(=Concat({<Country=E({$})>} DISTINCT Country, ',
'))'
)
Specifically, I do not understand how Aggr(Sum(1), Country)
"Will only evaluate for those countries that are currently selected because Sum(1) will be null
for the unselected countries. "
I always assumed that in order to evaluate only selected dimensions, 'countries' in this case, one should use '$'
i.e. Aggr(Sum($), Country
In addition, why would Sum(1) amount to null for the countries which were not selected?
thank you
0 - Represents an empty set
1 - Represents the full set of all the records in the application
$ - Represents the records of the current selection
$1 - Represents the previous selection
$_1 - Represents the next (forward) selection
I guess, you are mixing up '1' with '{1}'. If you use Sum(1), there is nothing to do with explicit set analysis. So by default, only the selected values/within scope values would be considered in expression. Whereas, had this been like Sum ({1} ...) - the result would have been irrespective of any selections.
Hope this helps.
is there a manual which describes '1' as a function parameter, such as SUM(1)?
I wanted to read more about it.
thank you