Calculate time difference from metrics - Explore

4 Comentários

  • Palash Haque

    A quick help with an explanation would be highly appreciated. Thanks in advance

    0
  • Hillary Latham
    Community Moderator

    Palash, because you are showing the update time in your query, you are only going to get 1 of your metrics per line (since there would only be one update per line).  If you remove this and just have the Ticket ID or some other grouping column, does it display more as you would like?  If not, you may need to expand your attribute calculation to also include more filters.  I.e. for the Agent to 2nd, I'm assuming you have some filtering for calculating this (change in group) - can you add that to your calculation so that you can filter to the ticket level and only have 1 line per ticket to get your numbers to subtract from 1 line properly?

    0
  • Palash Haque

    Thank you for your response. Yes, I'm using a filter to find specific change in group and retrieve its timestamp. What I want is to calculate time difference between these changes.

    So for Ticket 1030863, 

    I need to calculate the difference in time *EC_EN* - *2nd_line_services*, If i remove the timestamp from the row, we get single row for each ticket and then the calculations are incorrect.

    0
  • Hillary Latham
    Community Moderator

    Correct, you will not be able to do the calculations you want if you keep a single update on each row (i.e. showing the update timestamp attribute).  You cannot make calculations across rows.  

    In Explore, you will need to modify your custom attributes and metrics in the query so you only get 1 line per ticket (rather than per update), so both calculations would fall on the same line, then you can do the subtraction.  To do this, you just need to expand the criteria in your metrics (or attributes, however you built them).  For example, 2nd-to-Agent (secs) wouldn't just be the DATEDIFF, it would also be an IF statement for the criteria to identify which update to make this calculation (group ID, etc).  This way, when you collapse the rows to just be 1 per ticket, your metrics will still show properly in the single ticket line for both metrics.   Basically make the calculation independent of the query criteria - put all the criteria in the metric calculation.

    If you need to keep the update column in your output, the only thing I can think to do is to download your query results to Excel and do the calculation you need in Excel (where you can subtract between rows).  

    0

Por favor, entrar para comentar.

Powered by Zendesk