2 Replies Latest reply: Mar 28, 2012 3:42 AM by Leanne RSS

    Grouped queries not displaying correctly in WebDesk - calculation?

    Leanne Apprentice

      We are trying to publish a change schedule on WebDesk, so that all of the analysts can see changes which are scheduled, grouped by week.

       

      However, we have come across a limitation (confirmed by LANDesk) whereby grouped queries in WebAccess DO work, but not if the grouping is based on a range.

       

      Basically, we have created a query in Console, which shows changes in the past 7 days and in the next 6 weeks - to displayed grouped by week. This displays fine in Console, and returns the desired results - whereby you can expand the week to view relevant changes:

      image001.png

      However, when you add this query to a dashboard in WebDesk, it doesn't group the items - it lists them separately, which is far from ideal:

       

      image003.png

       

      We have even tried creating a dashboard in Console and publishing it to WebDesk - but it doesn't solve the issue.

       

      It has been suggested that we could perhaps use a calculation to sort the attribute by (calculation based on string attribute) - is there anyone who can provide any detail or information on how we can achieve this, as we are very new to calculations?  There is a field on the Change window called Target Implementation Date (in date format) which we want to sort and group the results by.

       

      Thanks in advance!

        • 1. Re: Grouped queries not displaying correctly in WebDesk - calculation?
          Jenny.Lardh SupportEmployee

          Hi Leanne,

           

          There is no feature to have queries grouping by other than the raw attribute in Web Desk.

          You cannot have a range of the Creation Date like you can in console.

           

          However, this can still be achieved with some design changes and use of a Calculation.

          If you create a string(100char) Attribute on the Incident Object and create a 'Before Read' Calculation to show the Week and Year you can then set your Query to Group by this attribute instead of the Creation Date and with this get the weekly grouping that you want.

           

          If you have already existing Incidents that you want included in this, you will need to create the Calculation, make sure that it's working and then run a scheduled calculation to set the value on all OPEN Incidents.

          (Please note that you will not be able to run the scheduled calculation on any Closed Incidents)

           

           

          The Calculation that you would need to use would be as follows:

           

          ---

          import System

          static def GetAttributeValue(Process):

          Cal = System.Globalization.GregorianCalendar()

          Date = Process.CreationDate

          Week = Cal.GetWeekOfYear(Date, System.Globalization.CalendarWeekRule.FirstDay, DayOfWeek.Monday)

          Value = String.Format(" Week ", Date.Year, Week)

          return Value

          ---

           

          You will need to set a dependency on "Creation Date".

           

          Kind Regards,

          Jenny

          • 2. Re: Grouped queries not displaying correctly in WebDesk - calculation?
            Leanne Apprentice

            Jenny - thanks for your response, however I am trying to achieve this on the Change process, and want to sort by a field we have on the Change window, which is Target Implementation Date and not change creation date - which will have a bearing on the calculation we need to use.