Dynamic default value for prompt
There is a report which allows users to select a shipment month. The Shipment Month dimension has values up to current month. However, users frequently select prior month. They want the prompt to have prior month selected by default.
Getting ready
Take any report that filters on Shipment Month Key. Add a value prompt to the Shipment Month Key on the prompt page.
How to do it...
Select the value prompt and define its sorting such that the Shipment Month Keys are populated in descending order.
Now, as we know the dimension is always populated up to the current month and values are sorted in descending order, we will write a code that selects second value from top by default.
For that, add an HTML Item just before the Shipment Month value prompt. Define the HTML as:
<span id = 'A1'>
Add another HTML item just after the value prompt and define it as:
</span>
Now add another HTML item to the prompt page footer, just after the Finish button.
Define it as...