Hi There:
I'm sure there is something simple I'm missing here. I want to take a number field (total number of seconds) divide it by a another field (number of calls) to get an average amount of time per call, displaying in hours, minutes and seconds. I keep getting the error "division by zero" and can't figure a way around it. It is possible to have no calls in a specific entry/interval. I'm working with multiple phone queues so I only want data from specific ones included. I keep trying to add an "Else" statement at the end to account for the dividing by zero scenario and get the error "the remaining text does not appear to be part of the formula."
So if I have
1 call wait total 30 seconds
1 call wait total 60 seconds
I should get 90seconds/2calls = ave wait 00:00:45
Here's my code:
------------
numberVar avedelay := ({iApplicationStat.CallsAbandonedDelay}/{iApplicationStat.CallsAbandoned});
numberVar hrs;
numberVar min;
numberVar ss;
Stringvar hhmmss;
hrs:= Truncate(Truncate(Truncate(avedelay/60)/60));
min := Remainder(Truncate(avedelay/60),60);
ss := Remainder(avedelay, 3600);
If {iApplicationStat.Application} = "Cust_Svc" then
If {iApplicationStat.Application} = "VRU_Transfer" then
If {iApplicationStat.CallsAbandoned}>0
Then
hhmmss := totext(hrs,"00") + ":" + totext(min,"00") + ":" + totext(ss,"00");
I'm sure there is something simple I'm missing here. I want to take a number field (total number of seconds) divide it by a another field (number of calls) to get an average amount of time per call, displaying in hours, minutes and seconds. I keep getting the error "division by zero" and can't figure a way around it. It is possible to have no calls in a specific entry/interval. I'm working with multiple phone queues so I only want data from specific ones included. I keep trying to add an "Else" statement at the end to account for the dividing by zero scenario and get the error "the remaining text does not appear to be part of the formula."
So if I have
1 call wait total 30 seconds
1 call wait total 60 seconds
I should get 90seconds/2calls = ave wait 00:00:45
Here's my code:
------------
numberVar avedelay := ({iApplicationStat.CallsAbandonedDelay}/{iApplicationStat.CallsAbandoned});
numberVar hrs;
numberVar min;
numberVar ss;
Stringvar hhmmss;
hrs:= Truncate(Truncate(Truncate(avedelay/60)/60));
min := Remainder(Truncate(avedelay/60),60);
ss := Remainder(avedelay, 3600);
If {iApplicationStat.Application} = "Cust_Svc" then
If {iApplicationStat.Application} = "VRU_Transfer" then
If {iApplicationStat.CallsAbandoned}>0
Then
hhmmss := totext(hrs,"00") + ":" + totext(min,"00") + ":" + totext(ss,"00");