Filtering a view using multiple criteria

In a real-life scenario you often want to create a list view that needs to filter by multiple criteria. This gets us to the old linking of criteria using AND and OR. Most people including me probably don’t quite remember their math classes.

One memory fragment coming to mind tells me to use brackets to group conditions and influence the outcome. But all of this doesn’t actually help in SharePoint land.

Let’s use a recent example. A colleague was trying to configure a view for a document library.
The library had columns for document type and business area amongst others.
The desired effect was to show all documents for a particular business area that were classified as either forms or templates.

She came up with the following formula:
[Business Area] = “Housing” AND [DocType] = “Form” OR [DocType] = “Template”

Looked reasonable to me, but once entered in the “filter section” of the view configuration page didn’t produce the expected result.

After some trialling and erroring – not sure if there is a word like that – we worked out that
using
DocType] = “Form” OR [DocType] = “Template” AND [Business Area] = “Housing”
actually worked.

Take home message: If you have a combination of AND and OR conditions always start with the OR and then add the AND condition at the end.


Leave a comment