good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
(Ovid) Re: sorting by quarterly calendarby Ovid (Cardinal) |
on Aug 27, 2001 at 20:12 UTC ( [id://108163]=note: print w/replies, xml ) | Need Help?? |
I think the following would work. I didn't try to adjust for null dates as I have no idea what your data format is. The snippet sorts by year, then by quarter, then by day.
Here's what it does:
Each array ref is going to have the quarter as the first element, the date as the second and the data as the third. You're going to have to play with the above snippet as you need to account for null dates. Further, I really didn't test this for multiple quarters spanning multiple years (I assumed you'd have one fiscal year of data at a time). Cheers, Vote for paco! Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
In Section
Seekers of Perl Wisdom
|
|