Changing Filter Order & interaction between "and" and "or"

When filtering a Table(view), is there a way of rearranging the order of the filters I have added? Since I am working with “and” and “or” I need a way of adding a filter to a previously defined group of “or” filters.
Also another question regarding the handling of the “or” operator in this case. Lets imagine I have filters set up like this:
A
and
B
or
C
and
D

will it be interpreted as A and (B or C) and D or as (A and B) or (C and D)?
If the former is the case, is there a way of creating the latter? (workaround would be with formulas I imagine)

Hi @Kevin_Donath,

How it is executed depends on how you present it.

I have created a demo doc here.

The filter I have used is that the Name number must be greater than 1 and less than 3, or greater than 4 and less than 5. This should limit the result to rows of 2 or 5 only.

The filter can be written as:
OR(thisRow.Name>1 AND thisRow.Name<3 , thisRow.Name>4 AND thisRow.Name<6)
Simplified this will be: OR( A AND B, C AND D)

or as:
(thisRow.Name>1 AND thisRow.Name<3) OR (thisRow.Name>4 AND thisRow.Name<6)
Simplified this will be: (A AND B) OR (C AND D)

The bracket locations are important as they dictate where the arguments start and end.
Argument 1 is (thisRow.Name>1 AND thisRow.Name<3)
Argument 2 is (thisRow.Name>4 AND thisRow.Name<6)

In the middle is the OR. So if a row meets all the conditions of Argument 1 OR the conditions of Argument 2 then display it.

I have thrown in some additional more complex examples.

I hope that this makes sense and helps.

Kind regards

Dale

2 Likes

Hi @Dale_Cowling,

Thank you very much for your reply. Could you please grant me editing rights to the doc so I can view the filters you have created?

Hi @Kevin_Donath,

I have published the doc here for you to access and copy.

https://coda.io/@dale-cowling/kevin-donath-changing-filter-order-interaction-between-and-and-o

Kind regards

Dale

Hi @Dale_Cowling,

Thank you very much. I also just discovered the function to transform all the filters into one function.

Thank you for your help.

Best regards
Kevin