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.


Another SharePoint resource – Is it really necessary?

Well, maybe not. This resource however is squarely aimed at the millions of people who have been “gifted” with this equally amazing and infuriating <insert preferred term here>.

I have been working with all of the SharePoint versions since its inception under the name of Tahoe. Yes, I’m that old. The common thread is ever increasing functionality, but also a staggering amount of inconsistencies and gotyas.

So this blog will bring you solutions to some of these irritating inconsistencies as they come to my attention.

Feel free to also post questions. However don’t look for coding solutions, system administration tips or the latest jquery wizardry. There are more than enough other resources that focus on these issues.