How do I make OR filters when using Filters on Measures?

Knowledge Drop

Last Tested: Sep 6, 2019

This is outlined in a Help Center article. For a single field with multiple values, you can put them all into the filter string:

measure: count_field {

type: count

sql: ${TABLE}.total_orders ;;

filters: {

field: orders

value: "1, 4, null"

}

}

Where we end up filtering WHERE orders = 1 OR orders = 4 OR orders IS NULL.

If you want OR logic between two different fields, put the conditions into the SQL of a yesno dimension and filter on the yesno being "yes".

dimension: this_or_that {

type: yesno

sql: ${fish} = 'red' OR ${eggs} = 'green' ;;

}


 

This content is subject to limited support.                

Version history
Last update:
‎04-05-2021 09:08 AM
Updated by: