Forum Discussion

cglowe's avatar
cglowe
Cloud Apps
02-23-2022

Advanced Date Filter - Allow User to Select Different Dates

I have dashboards that I want to be filtered, by default, to current month + previous 12 months, as shown below.  However, I also want end users to have the ability to select a different date range if they want.  My issue is that when end users go to edit the date filter, they see the JAQL below, which will likely not be intuitive to them.  Is there a way to have all months show up in the filter, like a normal list view, while also defaulting to the most current 13 months?

 

1 Reply

Replies have been turned off for this discussion
  • BobF's avatar
    BobF
    Data Storage

    Hi

    I've done something similar, adding a new custom field e.g. "Monthly_Report_Date", based on the date, using a Case statement to build it up. You can add as many values you want. Below shows an example for just 3 values

    Case
    WHEN MonthDiff(CURRENTDATE(),[<Your_Date>])=0 THEN 'Current Month'
    WHEN MonthDiff(CURRENTDATE(),[<Your_Date>])=1 THEN 'Last Month'
    WHEN MonthDiff(CURRENTDATE(),[<Your_Date>])=2 THEN 'Two Months Ago'
    END