2 Replies Latest reply on Mar 10, 2011 11:13 AM by dunnkster

    Summing numberic data in queries


      I am writting a query to be used in Webdesk that shows all time logged by Analysts in a day.  I can do this fairly well but I would like to sum the Time Spent column.  Is this possible?  How would I do this?

        • 1. Re: Summing numberic data in queries
          afrogers Apprentice

          Is the time spent a calculation based on the time since the incident was created or the amount of time an analyst has spent actual working on an incident?  If its the latter I would appreciate picking your brains on how you achieved this, as this is something we're looking to implement.


          On the sum issue, I got round adding monetary values in a procurement process by pumping the values into a Crystal report which is then generated by a report reminder in the process.

          1 of 1 people found this helpful
          • 2. Re: Summing numberic data in queries

            We are summing the time an analyst actually spends working on an Incident.  We are curretly using a vary scaled down implemetation of Service desk.


            To sum the actual time we added a time spent to the Notes windows and have analysts put in what they did and the number of minutes they actually work on the incident.  (If you want hours set it up to allow decimals and set 15 minutes = .25).  We then added a total time spent field to the Incident window and added a calculation.


            The field was created as an Int16 and in the formula attributes we set Calculation type = After Read and Calculation Formula to:


            import System
            static def GetAttributeValue(Incident):
            totalTimeSpent = 0
            for noteTime in Incident.Notes:
              totalTimeSpent = totalTimeSpent + noteTime._TimeSpent
            return totalTimeSpent


            You then have to add the total time spent field to the Incident query fields to get it to display correctly.  (The field is updated then after a query is run)


            I will admit though I recieved most of this from training I took at LANDesk.  Hope this helps.