Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
stekol61
Creator
Creator

calculate average value on timestamp in a graph

Hi!

I have calculated values for response time (during Business Hours) for tickets.

I want to present average response time per month.

I converted the timestamp values from 'hh:mm:ss' to minutes into a new variable (response_time_bh (min:))using this formula: 

(Num#(Subfield(winc_response_time_bh,':',1)) *60
+ Num#(Subfield(winc_response_time_bh,':',2))
+ Num#(Subfield(winc_response_time_bh,':',3))/60

Then I can easily calculate the average response time in a table.

When i try to do the same in a graph it doesn't give the correct value.

Any suggestion how this can be solved?

Ticket IDresponse_time_bhresponse_time_bh (min)
OP-000001700301102:01:456 121,8
OP-00000169752203:19:41199,7
OP-00000168955805:03:43303,7
OP-000001665107278:34:0016 714,0
OP-000001655877302:03:5518 123,9
OP-000001653706296:02:0717 762,1
3 Replies
TimvB
Creator II
Creator II

You can add the field "response_time_bh_min" to the script and then to the chart. This also improves the performance of the app as less calculations are needed in the UI.
stekol61
Creator
Creator
Author

Hi!

I added this to the load script:

LOAD
(Num#(Subfield(response_time_bh,':',1)) *60
+ Num#(Subfield(response_time_bh,':',2))
+ Num#(Subfield(response_time_bh,':',3))/60)as new_response_time_min_bh

It works but the result is 'hh:mm:ss' and I don't thing I can calculate an average on that format.

Also the 'response_time_bh' is calculated in the load script with the format  'hh:mm:ss' 

stekol61
Creator
Creator
Author

Hi!

After a closer look at this I can see that it's not working. The new variable is not created.

It seems as if you can't created a variable based on another variable in the load script