By creating a top/bottom N filter, we allow the end users to select whether they want to display the top N countries (that is, countries with the most CO2 emissions) or bottom N countries (that is, countries with the least CO2 emissions). To do this, we need to use a parameter that determines if they went to the top or bottom.
To ascertain which countries belong to the top or bottom, we use the Rank
table calculation function. We determine whether the rank sorting is in ascending or descending order using the Country CO2 Rank
calculated field. If we select Top
,SUM([CO2 Emission])
is sorted in descending order (that is, the most first) and if we select Bottom
,SUM([CO2 Emission])
it is sorted in ascending order (that is, the least first):
Placing the Country CO2 Rank
calculated field with the rank calculation as a discrete field between Year
and Country Name
is an important step to make sure that the ranking works. This can thus limit the scope per year, letting...