In this recipe, we will create a bar chart that can display the top N or bottom N countries based on CO2 emission, a world development indicator (WDI) tracked by the World Bank.
To follow this recipe, open B05527_03 – STARTER.twbx
. Use the worksheet called Top N Bottom N
, and connect to the CO2 (Worldbank)
data source.
The following are the steps to create a bar chart with a top/bottom N filter:
From Dimensions, drag Year to the Rows shelf.
From Dimensions, drag Country Name to the Rows shelf, to the right of the Year pill.
From Measures, drag CO2 Emission to the Columns shelf.
Right-click the arrow beside the Dimensions section in the side bar, and select Create Parameter.
Create a string parameter called Top or Bottom? with the following settings:
Show the parameter control for Top or Bottom?. You can do this by right-clicking on the parameter, and selecting Show Parameter Control.
Create a calculated field called
Country CO2 Rank
, with the...