Skip to main content

How to use Tableau to filter two or more conditions as shown as in (i), (ii), (iii), (iv)? Conditions can be OR, AND or both.

Full data :

Use filter when two or more conditions are metConditions are in blue in (i), (ii), (iii) (iv). Results are shown in first two columns.

af6 

af7

2 answers
  1. Aug 7, 2021, 7:05 PM

    @Wendy Lai​ hi there,

    you need to apply multiple LOD calculations.

    For each type of of food you can create a new calculation:

    { FIXED [Customer]: COUNTD(IF [Order Type]="Bird Food" THEN [Order Type] END)}

    In the end it is better to have a parameter switch for each combination you have (1,2,3,4).

    Here is the calculation:

    CASE [Conditions]

    WHEN 1 THEN ([Cat Food]=1 AND [Dog Food]=1)

    WHEN 2 THEN ([Cat Food]=1 AND [Dog Food]=1 AND [Fish Food]=1)

    WHEN 3 THEN ([Cat Food]=1 OR [Dog Food]=1)

    WHEN 4 THEN (([Dog Food]=1 AND [Fish Food]=1) OR [Bird Food]=1)

    END

    See attached document.

    Please mark it as best answer or like it.

    thanks,

    Adrian

0/9000