In this recipe, we will explore how to display different dimensions in the same graph using a parameter and calculated field.
To follow this recipe, open B05527_03 – STARTER.twbx
. Use the worksheet called Dynamic Dimension
, and connect to the MasterTable (FlooddataMasterListrev)
data source.
The following are the steps to create a chart with dynamic dimensions:
Dimension to Display
with the following settings:Selected Dimension
, with the following formula:0
) decimal places Normally when we create our charts, we choose the dimensions and measures to display and place them on the appropriate shelves or cards.
For example, if we wanted to show flood damage by Country, our Rows and Columns shelves would look like this:
If we wanted to show it by Main Flood Cause, we would replace the Country pill in the Rows shelf with Main Flood Cause:
What we have done in this recipe is introduce a parameter so that our end users can decide which dimension they want used in the Rows shelf. The parameter called Dimension to Display elicits the choice from our end users. Once the choice is made, a calculated field identifies which dimension should be used:
This calculated field needs to replace the dimension pill we have in the Rows shelf.
With the calculated field Selected Dimension in place, what is being displayed can now be dynamic, as the dimension changes when the parameter choice changes.
52.14.82.217