Sharepoint By Dummies

See Also: http://stephenbooth.brandyourself.com/

Filter operator precedence does not imply grouping?

leave a comment »

I’ve also posted this to Egghead Cafe asking for any ideas on how to resolve the issue.

We have a dashboard page which contains a number of views on different lists (WSS 3.0 + Sharepoint Designer 2007). 4 parameters are passed in the URL with this page which are then captured (Param1 through Param4) and used in filters on the views, one of these filters is causing a problem. This filter was written by someone else who is not available at this time.

The filter is (using braces ({}) to indicate grouping)

 {Project = [Param1]
OR
Project = [Param2]
OR
Project = [Param3]
OR
Project = [Param4]}
AND
Actual Compltion Date > [CurrentDate]
OR
{Action Completion Date is Null
AND
Expected Completion Date > [CurrentDate]}
AND
{Project = [Param1]
OR
Project = [Param2]
OR
Project = [Param3]
OR
Project = [Param4]}

It looks to me like the guy who originally wrote it is assuming that there’s an implicit grouping either side of the central OR (this would be consistent with the behaviour the users are expecting) but the results of the filter indicate that this is a false assumption.

What the user is looking for is:

If the project name is one of those given in the parameters and there is an actual completion date which is in the future the show the item. If the proejct is one of those given in the parameters and there is no actual completion date but there is an expected completion date which is int he past then show the item.

Were I writing this as a SQL where clause (my background is as an Oracle DBA) I’d probably be looking at something like:

 (Project IN (p1, p2, p3, p4) and (ActualCompletedDate > SYSDATE OR (ActualCompletionDate IS NULL and ExpectedCompletionDate < SYSDATE))

Sharepoint Designer won’t let us do the nested grouping required for that (or to do the grouping the original filter writer apparently thought was implied by the operator precedence).

I have not yet been able to find a way to realise this filter using the filter criteria in Sharepoint Designer, cannot eliminate the need for nested grouping.

 

ETA: Found a blog entry on how to do grouping so left a comment asking if nested grouping is possible.

Advertisements

Written by stephenboothuk

August 9, 2011 at 4:36 pm

Posted in Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Speeches I Would Have Given

What I would have said at conference

markvale.wordpress.com/

Maybe mildy useful to someone!

David Hunt, PE... Mechanical Engineer on the loose!

VALUE = Creativity + Diverse Experience + Critical Thinking

Not Literally Productions

Comedy, parody, tutorials and more!

catastraspie

A personal blog about having Asperger's

Dementia and Elderly Care News

News and research of interest to people involved in Dementia and Elderly Care

Marc D Anderson's Blog

A Knowledge Management Zealot Speaks Out

Codeless Solutions for SharePoint

Bryon Wyly is a SharePoint Developer dedicated to finding the limits to out-of the-box SharePoint solutions

gordonlyew.wordpress.com/

the political blog of gordon lyew

SharePoint Business Analyst

Just another WordPress.com weblog

%d bloggers like this: