1 of 1 people found this helpful
An interesting approach to relative date filters - I'm assuming you would only want some of the options rather than all which is why you would want the drop down.
This is easily achievable with some calculated fields. Following the screenshot you posted, you would need three calculated fields that would correspond to each of the available options. I'm going to assume your data uses a date field which is called [Date].
Calc Field 1: 30 Filter Switch (Assuming this means last 30 days)
IF(DATEDIFF('day', today(), [date]) < 30) THEN TRUE ELSE FALSE END
Calc Field 2: MTD Filter Switch
IF(Month([Date]) = Month(today()) AND year([date]) = year(today())) THEN TRUE ELSE FALSE END
Calc Field 3: YTD Filter Switch
IF(year([date]) = year(today())) THEN TRUE ELSE FALSE END
Next, create a parameter with your three values (in this case). We'll call it Selected Date Filter and the values will be 30, MTD, YTD
Finally, you would tie together these three fields with a case statement - which will act as your dynamic filter.
CASE [Selected Date Filter]
WHEN '30' THEN [30 Filter Switch]
WHEN 'MTD' THEN [MTD Filter Switch]
WHEN 'YTD' THEN [YTD Filter Switch]
Let me know if this is what you're looking for and if you have any other outstanding questions.
Thank you, this looks like it worked.