Knowledge Drop

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

  • 5 April 2021
  • 0 replies
  • 46 views

Userlevel 4

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.                

 

 

 


0 replies

Be the first to reply!

Reply