More Control on Dashboard Date Filters

Thanks for the detailed elaboration!

Just sharing, the Query Parameters might not be the best solution, however, it can open more use opportunities to manipulate your data, it can even solve partially the filter group problem. Below is how I imagine that it would solve your use case with Query Parameter

In your aml files


query_parameter custom_time_period {
  allowed_value: [
    last_7_days_in_US,
    last_30_days
  ]
}

Model orders {
  query: @sql
    select ...
    where
       {{ #if custom_time_period  = 'last_7_days_in_US' }}
          // ... conditions
       {{ #else #if custom_time_period  = 'last_30_days' }}
          // ... conditions
       {{ #else }}
           // ... conditions
       {{ #endif }}  
}


There will be a Custom Time Period filter on your dashboard that allows users to select either Last 7 days in US or Last 30 days.

1 Like