2

I hope this will be a very basic question. :)

I am using a Task List in a SP 2010 Foundation site to keep track of work in progress with a small team. We are using the default Status values (Not Started|In Progress|Completed|Deferred). Everything is working well, but we're starting to see the Completed items pile up and take up all the room in our SP page that displays the task list.

I am trying to create a list view that will filter out the Completed items if they were last updated, say, more than 3 days ago. In the Create View page, I don't seem to have that capability with the default Filter tools. I can only filter on field values and not an item's last modified date.

Does anybody have any ideas?

1

I was able to implement this by using a customized View as with PirateEric's comment, but I needed to group the conditions in a way the GUI list view filter editor wouldn't let me. The solution involved using SP Designer 2010 to edit the CAML query for the filter directly. I figured out the query using the CAML Query Helper tool on CodePlex: https://spcamlqueryhelper.codeplex.com/

In my testing it looks like this works, but I'm not positive that I really need the IN condition.

    <Query>
        <Where>
            <Or>
                <In>
                    <FieldRef Name='Status' />
                    <Values>
                    <Value Type='Text'>Not Started</Value>
                    <Value Type='Text'>In Progress</Value>
                    <Value Type='Text'>Deferred</Value>
                    </Values> 
                </In>
                <And>
                    <Geq>
                        <FieldRef Name="Modified"/><Value Type="DateTime"><Today OffsetDays="-3"/></Value>
                    </Geq>
                    <Eq>
                        <FieldRef Name="Status" /><Value Type="Text">Completed</Value>
                    </Eq>
                </And>
            </Or>
        </Where>

  • It's a few days later and this has been shown to work. Completed items have been dropping out of the custom view as expected. – rayrayrayraydog May 17 '13 at 17:18
0

Create a calculated field with the following formula :

=IF([Status]<>'Completed';true;IF(DateDiff([Now],[Modified])>3;false;true))

and then use the created column to filter your items;

regards.

  • Thanks! I was also reading up on an approach similar to this and found that the "today" trick usually won't work because the calculated field is only updated when the list item is saved, and not when viewing the list. So, in one day's time the logic will not work. Is this still the case in SP 2010? – rayrayrayraydog May 14 '13 at 18:05
0

You don't need a calculated column to do this. Simply go to your tasks list and create a new view. Expand the filter section and add Status is not equal to Completed AND Modified is greater than [Today] - 3. You can optionally expand the item limit section to return a max number of items.

  • I was able to get something working by doing this, but with some extra steps to be able to group conditions in the filter using CAML queries. I will post what I came up tomorrow as I am not allowed to answer my own question yet. – rayrayrayraydog May 14 '13 at 20:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.