Hello!
I have an analysis that uses Reporting Period as a control over a parameter named “Granularity” which contains specific values - MONTH, QUARTER, YEAR, YTD, CUSTOM_RANGE.
I created two additional parameters StartDt and EndDt and added two controls Start Date and End Date for them respectively.
How I want it to work is
- If the user selects MONTH as Reporting Period, show monthly data (filtered to the specific date range selected by the user via Start Date and End Date controls)
- If the user selects QUARTER, show quarterly data filtered to the date range
- and so on. This seems to be working fine. This is handled by an if else logic
I need to add the below logic and am a little confused about how to.
- If the user wants to see data for a CUSTOM date range (chosen via the date picker Start Date and End Date) they select CUSTOM_RANGE as the reporting period and the data should be aggregated at this level and display in a single column.
- If the user wants to see YTD data, when they select YTD as the reporting period, based on the start date and end date selected, YTD data should show. For example, if start_date = May 1 2022 and end is March 20 2023, there should be two values for YTD sales for example
May 1 2022 thru Dec 31 2022 Jan 1 2023 thru March 20 2023
Is this achievable? Thanks a ton! Happy to provide any more information if needed.