Date filters in the dashboard with "OR" condition

It it possible to make 2 or more date filters in the dashboard act based on "OR" and not "AND" condition? This is doable in explore with filter group but as far as I can tell, not possible as a dashboard filter. 

This (from dashboard):

SCR-20240730-mcgh.png

would produce this if explored

SCR-20240730-mcwu.png

What I want is the capability in dashboards filter settings to set them up with "OR" condition. 

Solved Solved
1 4 423
1 ACCEPTED SOLUTION

 

filter: stripe_refund {
type: date
}

filter: credit_refund {
type: date
}

filter: stripe_or_credit_refund {
type: yesno
sql: {% condition stripe_refund %} ${stripe_refund_date} {% endcondition %} OR {% condition credit_refund %} ${credit_refund_date} {% endcondition %} ;;
}

Something like this should do it! Make filter fields for both of the dates. They don't do anything by themselves. Then, create a yesno field which connects the filter fields to the actual date dimensions. 

You'll need to make sure users filter on "yes" for the yesno field, or use like a sql_always_where to make it always enabled on the explore. 

View solution in original post

4 REPLIES 4

Good question! This won't be possible from the dashboard level. One workaround would be to create a separate field with your OR logic and let users filter on that in the dashboard.

Sounds like a solution! Could you give me some example, please?

 

filter: stripe_refund {
type: date
}

filter: credit_refund {
type: date
}

filter: stripe_or_credit_refund {
type: yesno
sql: {% condition stripe_refund %} ${stripe_refund_date} {% endcondition %} OR {% condition credit_refund %} ${credit_refund_date} {% endcondition %} ;;
}

Something like this should do it! Make filter fields for both of the dates. They don't do anything by themselves. Then, create a yesno field which connects the filter fields to the actual date dimensions. 

You'll need to make sure users filter on "yes" for the yesno field, or use like a sql_always_where to make it always enabled on the explore. 

Thanks!

Top Labels in this Space
Top Solution Authors