How it works…

The Aggr() function works like the script load with the group by creating a virtual table with one measure (1st parameter) and one or more dimensions as 2nd to Nth parameter. In this example, the aggregation dimension is Country.

Combining Max() and Aggr(), we found the highest value for the number of customers over the list of countries.

We used FirstSortedValue(value, sorting_argument) to show the corresponding country with the highest value for the number of customers. It returns the value (Country) that corresponds to the result of the sorting argument. In general, the sorting argument is a field, but can also be an Aggr() expression that was used as the sorting argument. We add a - in front of the sorting argument to start the sorting from the highest to the lowest, and not from lowest to highest, which is the default sorting criteria.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset