Does the database view filter support combining multiple conditions with both AND and OR operators simultaneously?

Currently, Bika does not natively support mixing AND and OR operators directly in the filter function. Here’s a workaround to achieve this:

  1. Scenario Example:
    Suppose you have a sales database with columns Platform and SKU. You want to filter records where:
    Platform = "Amazon" AND (SKU = "SKU1" OR SKU = "SKU2").

  2. Step-by-Step Workaround:

  • Create a formula column (e.g., Is_SKU1_or_SKU2) with the expression:
OR({SKU} = 'SKU1', {SKU} = 'SKU2')

This returns True if SKU matches either value.

  • Apply the filter:
    Use {Platform} = 'Amazon' AND {Is_SKU1_or_SKU2} = True.

This mimics AND/OR logic by separating the OR condition into a formula column and combining it with AND in the filter.

The current filter function only supports text-based comparisons and cannot automatically detect the data type of formula column outputs (e.g., boolean, date, number). To ensure the workaround works:

  1. Modify the formula to force the output into a text format. For example:
OR({SKU} = 'SKU1', {SKU} = 'SKU2') + ""

This converts the boolean result (True/False) into a text string ("True"/"False").
2. Update the filter to use the text-based result:

{Platform} = 'Amazon' AND {Is_SKU1_or_SKU2} = "True"

This adjustment ensures compatibility with the current filter limitations. We appreciate your patience as we work to improve data type recognition in filters! :bulb: