Skip to main content
Closed

Allow Boolean expression in Filters

Related products:Industrial CanvasSearch and Data Exploration
  • May 5, 2025
  • 1 reply
  • 14 views

By default, filters in Cognite seem to be set to “AND,”  meaning that to get a successful return, if you have slected two criteria, the target bust have both properties.  There are times when the user wants to cast a wider net, and use “OR,” meaning that the filter will return results if either criteria is met in the filter.  For example, if the user wants results from two different platforms, but not all platforms.  Or, in some cases, the filter will not allow the user to select the filter element because of this property.  Suggest standardizing how filters work and allow user to select either “AND’ and “OR”

 

1 reply

Sofie Svartdal Berge
Seasoned Practitioner

Hi ​@Wrzyszczynski !
Thank you for sharing - fully agreed the filtering logic should be consistent. Can you share some more details about where in the product you are seeing inconsistencies in the filtering logic?

In Search (and the resource selector “add data” in Canvas and Charts), the logic we follow is; 

If you select several values for the same key/property, these are treated with an OR operation, while between keys/properties we apply an AND operation. Examples:

  • Say you are filtering Events. You select to filter on the key/property Type, and two values: workorder and notification. This selection is treated as: Type = workorder OR notification.

     

  • If you select another key/property in addition, like workcenter = mech, then this selection is treated with an AND operation, and the total filter is now: (Type = workorder OR notification) AND workcenter = mech. 

 

Best, 

Sofie Berge, Product Manager