0

Filter based on multiple columns

Good day,

 

Is it possible to filter a view based on different columns, e.g. we have columns 'Status', 'Country', 'Name', so I want to get the filtered table when (Status='Open' OR 'Closed' ) OR (Country = 'Germany') OR 'Name = empty.

 

It looks like the filtering could be based on the AND condition only with each new filtering being done on the filtered data.

 

Many thanks,

Eka

10 replies

null
    • Mel_Charles
    • 2 yrs ago
    • Reported - view

    eka

    I have a daybook veiw that fikteres my daybook for 

    a status of proof or dispatched

    how I achieved this is to go to edit cols in the view 

    add a formula - added Status = 1 or Status = 3 to the forumula ( using the number of the choice filed not the name ie proof is option 1 etc.

    Screenshot 2022-02-24 at 15.16.34

     

    results are

    Screenshot 2022-02-24 at 15.10.35

     

    the formula field is shown in postion 1 -  but you can move it over out of the way

    • simusolar
    • eka_ponkratova
    • 2 yrs ago
    • Reported - view

    Thank you so much for the response! My issue, though, is that I need to filter based on several columns using OR condition...

    • simusolar
    • eka_ponkratova
    • 2 yrs ago
    • Reported - view

    Thank you, Mel. No, unfortunately, in all links they talk only about the one field-based filtering.

    • Fred
    • 2 yrs ago
    • Reported - view

    Hi eka -

     

    To filter a table view on multiple fields with an or condition can not be done without another field, like Mel's first comment. So you could do something like this in a formula field:

     

    if field1 = 1 or field2 = 1 then 1 end

     

    Then you would add the field to your table view then filter for 1.

    • simusolar
    • eka_ponkratova
    • 2 yrs ago
    • Reported - view

    Thank you for the response! I realized that I didn't mention the important part. The field I refer to is in one table while others are in the linked table. The error I am getting - End expected: OR at line 1. It looks like the formula doesn't work for the linked tables.

    • Fred
    • 2 yrs ago
    • Reported - view

    Hi eka -

     

    Sorry I didn't read your first post. Your code could look like:

     

    if Status = "Open" or Status = "Closed" or Country = "Germany" or Name = null then 1 end

     

    That is assuming none of the fields are choice field.

    • Fred
    • 2 yrs ago
    • Reported - view

    Then you would just add the reference field name before the field. So if Name is in a table called People and the reference field in your current table is also called People then:

     

    if Status = "Open" or Status = "Closed" or Country = "Germany" or People.Name = null then 1 end

    • simusolar
    • eka_ponkratova
    • 2 yrs ago
    • Reported - view

    Resolved. Thank you, Fred! I also noticed that the 'OR' operator doesn't work while 'or' does.

    • Fred
    • 2 yrs ago
    • Reported - view

    Yes, Ninox is case sensitive with its commands. It is always lowercase.

     

    Glad things are working.