Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a script what have to calculate the outstanding time of support calls. There is a problem with the last record of each call (customer).
I have include an example. In the script there is a further explanation. Can someone help me further ?
Hi,
one possible solution might be:
SET vOfficeOpenFrom = '08:00';
SET vOfficeOpenTo = '17:00';
Supportcalls:
LOAD * INLINE [
Customer, Startdate,Enddate
1, 01-01-2014 16:50:00, 03-01-2014 09:10:00
2, 13-03-2014 16:00:00, 14-03-2014 09:00:00
3, 13-04-2014 16:00:00, 16-04-2014 16:00:00
];
SupportCallDays:
LOAD Customer,
DayName(Startdate+IterNo()-1) as Day,
IterNo() as ID,
Round((RangeMin(Enddate,Floor(Startdate)+IterNo()-1+Time#('$(vOfficeOpenTo)','hh:mm'))-RangeMax(Startdate,Floor(Startdate)+IterNo()-1+Time#('$(vOfficeOpenFrom)','hh:mm')))*1440) as Minutes
Resident Supportcalls
While DayName(Startdate+IterNo()-1) <= Enddate;
hope this helps
regards
Marco
Hi,
one possible solution might be:
SET vOfficeOpenFrom = '08:00';
SET vOfficeOpenTo = '17:00';
Supportcalls:
LOAD * INLINE [
Customer, Startdate,Enddate
1, 01-01-2014 16:50:00, 03-01-2014 09:10:00
2, 13-03-2014 16:00:00, 14-03-2014 09:00:00
3, 13-04-2014 16:00:00, 16-04-2014 16:00:00
];
SupportCallDays:
LOAD Customer,
DayName(Startdate+IterNo()-1) as Day,
IterNo() as ID,
Round((RangeMin(Enddate,Floor(Startdate)+IterNo()-1+Time#('$(vOfficeOpenTo)','hh:mm'))-RangeMax(Startdate,Floor(Startdate)+IterNo()-1+Time#('$(vOfficeOpenFrom)','hh:mm')))*1440) as Minutes
Resident Supportcalls
While DayName(Startdate+IterNo()-1) <= Enddate;
hope this helps
regards
Marco