Creating a custom date period filter
In this recipe, we will create a custom date period that will drive the labels and detail shown in our time series graph.
Getting ready
To follow this recipe, open B05527_03 - STARTER.twbx
. Use the worksheet called Custom Date Period
, and connect to the DOHMH New York City Restaurant Inspection Results
data source.
How to do it…
The following are the steps to create a chart with a custom date period parameter:
Right-click the arrow beside the Dimensions section in the sidebar, and select Create Parameter.
Create a string parameter called
Select Period to Compare
with the following settings:Show the parameter control for
Select Period to Compare
. You can do this by right-clicking on the parameter, and selectingShow Parameter Control
.Create a calculated field called
Period
with the following formula. Don't worry if this is a little bit long, we will explain what each block does in the following How it works section.Create another calculated field called
Custom...