go ahead... be a heretic | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I am looking for a good way to sort a report that I have based on a QUARTERLY calendar...
I wonder if you may be reaching for the wrong hammer. Unless you have some requirements that aren't stated, the problem you face is how to find "breaks" in a sorted list of calendar entries, where the breaks correspond to changes in quarter. Sorting by date is easy. There are some pointers in this thread that'll get you there. Given the date format you're using (month/day/year), spotting breaks in a sorted list is also easy: Process the list in order. For each entry, extract the month and use it as a key to lookup the quarter in an array or hash, and do your break whenever the quarter changes. The basics of that technique are touched on in Vsarkiss's and CLive ;-)'s posts above.
In reply to (dws)Re: sorting by quarterly calendar
by dws
|
|