Project Center Views – Filtering Client v Server


I have been waiting for SP1 before blogging this as it might have frustrated a few people as pre SP1 there were some broken pieces here.  The filter that you use when creating a view for everyone through Server Settings, Manage Views behaves slightly differently from that found on the client side when a user creates their own filters.  So why is this?  To explain I will use the example of filtering for particular project types.  I will base this on the out-of-the-box Project Center, Summary view, with the field Project Type added.

Here is a view of my starting point view - where "Maintenance Project" is the term for Proposals and Activity Plans.

image

When adding a filter on the client in Project Center the filter works as most people would expect - it is doing a text comparison.  If I want to just see Maintenance Projects I can set a custom filter where the Field Name Project Type contains the word Maintenance.

image

And then we see:-

image

But if we want a view that users can choose that automatically has this filter then we probably want to define it on the server. Setting exactly the same filter in the view definition for Summary in Manage Views gives this:-

image

Why is nothing showing up?  The reason is that server side filters are not working quite the same as on the client - and are doing their comparisons against an enumeration of the Project Type defined as a number.  Maintenance Projects have a Project Type of 4 - so with a filter set like this - where Project Type equals 4

image

we get what we want on the client with no client side filters set.

image

Enumerations for various of these kind of things can be found in the SDK.  This different behavior makes more sense when you look at different language versions.  If you have created a PWA site in French for instance you can set a server side filter for Maintenance Project without needing to know the French term.  Remember on the server you can filter on a field that is not displayed - so it isn't as silly as it sounds...

image

I know in this case it wouldn't make much difference - maintenance is maintenance - but other translations may be more challenging (at least to me).  This is a site provisioned in Korean, and viewed with IE set to French - just so you can see we are still looking at the same field.

image

I hope this helps you understand why there are differences in the filters - and how to use them.

Technorati Tags: Project Server 2007


Comments (12)

  1. MP says:

    Thanks for that explanation.  That problem was very confusing.  Any insight on how you prepare a filter that will show a date range based on “today”?  It would be great to be able to show all items that have a start date within two weeks of today for example.

  2. MP says:

    Also, why doesn’t Status Manager show up in any of the views as a field?  An obvious thing to want to see is who is responsible for approving tasks!

  3. Hi MP – Status Manager seems to be an ommission.  One workaround for Task views is to create a new Custom Field (Task, Text) based on the formula = [Status Manager] and then this field can be added to a view. I couldn’t see a quick way to also get this working for Assignment views so may be of limited use.

    Best regards,

    Brian.

  4. Hi MP – and asking around I couldn’t find a way to introduce dynamic date variables such as Today or Now.  I will ask a bit wider…

  5. DDoyle says:

    What if the field you are trying to filter on will not show up in the filter dialogue box on the “Manage Views” but will on the Project Center?

    It is a custom field that may contain multiple values selected from a lookup table.

    It will work for the Project Center view, but in “Manage Views” it will not populate the filter dialogue box in the field drop down box with the custom field if it is a multi-select field.

    Thanks!

  6. azjimwoodny says:

    Any update on how to filter via a dynamic date variable at the PWA view level?

  7. Nora says:

    I applied a filter to a custom view, when i try to display project using the custom view the task are in different outlines? do you know what could be the problem and not sorted.

  8. Hi Nora,

    I probably need a little more detail to understand which kind of filter you applied, and to which view.

    Best regards,

    Brian.

  9. Jim says:

    I just wanted to chime in as another person trying to figure out how to set a dynamic date range in a filter.

    I want to set up a "Stale Published Date" report that would show which schedules had not been published in the last two weeks. I can set up a hard date, but would rather set up a filter something like this: now()-14. The Validation routine didn’t like the formula.

    I tried creating a custom field with the value of now()-14, but using the field name as criteria wouldn’t work either–the Validation is apparently looking for something in a mm/dd/yyyy format and won’t accept anything else.

    Any other suggestions / approaches would be appreciated.

  10. santhiya says:

    How to use formula to check whether date field contains value or not.

    In project professional they are using

    Actual Finish =NA.

    How can we use it PWA.

  11. Hi Santhiya, I noticed my colleague BrianKen answered in his blog – but for completeness I’ll also post his answer here:

    "As you found you cannot filter for “equals NA”. You also cannot filter for ‘”contains /”. Both of these give you an error when you try to save your filter.

    What you can do is test to see if the value in the date field is greater than 1/1/1984. If it is greater than 1/1/1984 then the field contains a valid date.

    So “is greater than 1/1/1984” will return only rows where the date value is NOT “NA”. The hard part is that you cannot use this idea to have a filter only show rows there there is NOT a date. The filtering mechanism does not seem to understand the idea of NA.

    So the workaround for this is to do a ‘does not contain’ filter for a character that you know will always be in your dates but NOT the forward slash character (which throws an error.) If your dates for this field will always be in this century and you always use regional settings that show four digit dates then you can use this filter:

    “does not contain 2”

    This filter will return all rows that do not have a date in them if you use 4 digit years and your dates are always greater than 12/31/1999."

    http://blogs.technet.com/projectified/archive/2009/06/16/3255516.aspx

  12. AR says:

    I have a question. If I need a view with various filters, for example:

    Region/Country: Peru OR

    Region/Country: Ecuador

    AND

    Status: Finished OR

    Status: Cancelled OR

    Status: Stand by

    ¿How can I do that view? if I make like this the view show me all status projects from Perú and Ecuador

    I can use "equal/ no equal"  only because de values are from a list.

    Thanks so much

Skip to main content