Dear Monks,
Im in need to do a report of calls per Timeframe, i will give some Infos what i mean.
what i have is the start time and the duration
Examples: format is yyyyddmmhh24miss;seconds
20090302173742;362
20090306185330;27
20090302170758;6871
20090301195442;35201
Based on that data i need to put the duration in propper Timeframes, the Frames are:
7-9
9-18
18-19
19-7
weekend
The Result should look like this
| Start Time | 7-9 | 9-18 | 18-19 | 19-7 | weekend |
| 20090302173742 | 0 | 362 | 0 | 0 | 0 |
| 20090306185330 | 0 | 27 | 0 | 0 | 0 |
| 20090302170758 | 0 | 3122 | 3600 | 149 | 0 |
| 20090301195442 | 0 | 0 | 0 | 20483 | 14718 |
The duration should be sorted to the Timeframes, and if a call is on a weekend but going into a monday,
then the rest of the duration need to be sorted as well.
Im at the Beginning of writing the script,
i would Go with Date::Calc for the date calculations and a while duration > 0 loop with alot of IF's to split the duration into the propper slots.
A hint how to make it better is much aprechiated
kd ultibuzz
In reply to Sorting Call durations into Timeframes by ultibuzz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |