3 Replies Latest reply on Apr 18, 2017 12:01 PM by Jamie Cannon

    Question about grouping the results of a query by range (monthly)

    abeln Rookie

      My question is about grouping the results of a query by range. When I'm in the Query Designer I select "Group-->Range-->Monthly".

      After saving the Query the expected results were grouped monthly, but when I clicked on the Query again the results were no longer grouped by month, but by day. Then I tried to change the query and what I found out was that "Range" had no selection anymore. Seems like it is just working a single time after saving a query. Any suggestions?

      Is it a bug?

       

      I'm using Service Desk 7.8.5

        • 1. Re: Question about grouping the results of a query by range (monthly)
          Jamie Cannon ITSMMVPGroup

          This one has always been an issue in my opinion.  It gives the full date range which is bizarre.  What I've done is created a new calculated BeforeSave attribute on process that looks something like this:

           

          Value = ''

           

          if RaiseUser != null:

              if CreationDate != null:

                 Date = Process.CreationDate

                 Month = Convert.Date.ToString("MM")

                 Yeah = Convert.Date.ToString("yyyy")

           

          return Month

           

          That should return the month of the creation date into a string.  Since it's before save, this will store in the database which means you can group on them in your query.  if you want to return the year, just use "return year" or to get both return Month + " " + Year

           

          Hope this helps a bit.

          • 2. Re: Question about grouping the results of a query by range (monthly)
            abeln Rookie

            So I create a new attribute in the change.
            Then I put the calculation.
            In the query, I then pull this attribute also? And then it should work?

            The support of Ivanti has shown me that it works in the version 2016.4.
            .

            • 3. Re: Question about grouping the results of a query by range (monthly)
              Jamie Cannon ITSMMVPGroup

              That's correct.  You'll have to do the calculation as a BeforeSave though on the field you want ( like Creation Date ).  I have 2016.4 and here are my results searching all Incidents by Creation Date (monthly).  I've only been able to get it working using the calculation method, but I'd be open to see it working natively out of the box.

               

              Console:

              Web Desk (doesn't even seem to really group by Month)

              Workspaces, it doesn't seem to render.