Parameter: 13 months on a rolling basis or the whole year.
Hello everyone,
I would like to add a parameter to a report that allows me to show either the last 13 months on a rolling basis or the whole year.
However, if I include it in a parameter, it shows me all values from the periods, i.e. April 2024 - April 2025.
If I aggregate the values, I get the two options ("Rolling" and "Full year"), but the bar chart then logically only shows one column.
Does anyone have a solution?
Many thanks and best regards
Jona
(Formulation for rolling)
(Visual for rolling)
(Formulation for the year as a whole)
(Visual for the whole year)
2 replies
-
Hi
The approach you want to take is to employ the Switch function to switch between two lists, a parameter can then drive this
The example I will take you through can be found on our Explore server here
You can find details on how to sign up to Explore here.
In my example, I have a discover called 'SalesDiscover' which is driven by a parameter that shows me either 'This Year' or 'Rolling 13 months '
to achieve this I have a list called 'Months - Switch List' which uses a Global Parameter called 'Month Parameter' to switch between two predefinded lists ( Current Months - Year and Last 13 Months)
This will give you the required interaction for your discover
Additionally, I noticed that the lists you created were hard-coded to include the elements you wanted; this can be achieved more dynamically.
If you look at my example, there is a list called 'Current Full Month', the purpose of this is to return me the current month based upon the PQL function CurrentPeriod
I am getting the member from my date dimension [date].[date] that relates to the current date and finding the member [date].[date full month name] that it relates to by using a NonEmpty.
With this set, I can then create a dynamic set that will return me the rolling 13 months required, which employs the Range command
To get the required 13-month range, I set the end period using an element from the 'Current Full Month' set. The start period is then determined by applying a Lag(12) to this same element.
Likewise, with the Full year of months, I have created a list called 'Current Months - Year'
Here I use the FullYear PQL function, this returns all of the elements for a year for a relating to a member. This can be use then to provide the months required to represent the Full Year.
I hope this helps
thanks
Mark.