4 Replies Latest reply on Mar 19, 2018 12:19 PM by bsorensen

    Previous Week Filter

    bsorensen Apprentice

      Is there an easier option for this?

      I don't want to redo a search every Monday.

       

      In Incidents, Tasks, and Service Request we are looking build the same table of search results.

       

      I am looking to have search that gives me the previous weeks update.

      Example

      Incidents - Created Incidents by Department

       

      I need to have the created date be the previous week and I need to make sure the Resolved Date and Time column is in the report.  To do this, I created the following

      search for week.png

      No each week I need to go back in and change the top 2 fields.

       

      I see there is a During option, but it only allows me to pick one date, and then errors as there is no end date.

       

      Anyone have an easier solution?

        • 1. Re: Previous Week Filter
          AllenV Rookie

          You could try using CreatedDateTime Greater or Equal to $(BeginningOfWeek(-1)) AND CreatedDateTime Less than $(BeginningOfWeek(0))

           

          2018-03-16 09_36_08-Clipboard.png

          1 of 1 people found this helpful
          • 2. Re: Previous Week Filter
            bsorensen Apprentice

            Thanks!

            This gives me a Sunday to Saturday range, which is a lot better.

            We do Monday to Sunday. 

             

            I thought changing to Start to (0) and the end to +1 would work, but that just gives me 1 day.

             

            I will play with this. Thanks!

            • 3. Re: Previous Week Filter
              AllenV Rookie

              I think to add a day you would need to use $(AddDays(1, BeginningOfWeek(-1))) to start on a Monday and then subtract a day to end on a Sunday it would be $(AddDays(-1, BeginningOfWeek(0)))

              2 of 2 people found this helpful
              • 4. Re: Previous Week Filter
                bsorensen Apprentice

                THanks @AllenV

                Think I am getting closer

                 

                Using the code you gave i did the following

                Created equal or greater than $(AddDays(1, BeginningOfWeek(-1))) - this gives me the Monday as my start !  YEAH!

                however...

                using less than or less and equal with $(AddDays(-1, BeginningOfWeek(0))) gives me the Friday, if I use the previously mentioned one i get the Saturday.

                So to make it even weirder, i figured if I use $(BeginningOfWeek(0)), but change the 0 to a 1 I would get Sunday.  Instead I get Monday.

                 

                Back to the drawing board for the end date.