[ABE.pm] Is this a crazy idea?
Faber J. Fedor
faber at linuxnj.com
Sat Feb 3 08:53:02 PST 2007
I'm working on a web-based graphical report. (I'm using Chart Director
(http://www.chartdir.com/) which freaking rocks for creating charts.)
What I'm graphing is deciled data over time, e.g. take the S&P500, break
it into 10 pieces of 50 companies each, average the values for a
specific variable for those companies and do it for each month between
$startdate and $enddate. Repeat for the the different variables (up to
22), for each index (currently 12) such as S&P400 (40 companies each in
each decile), Russell 3000 (300 companies in each decile), etc. On top
of that, there are two ways of deciling which I won't get into.
Since it takes up to four minute to generate the datasets, I figured I'd
create a separate MySQL table for each combo (index, variable, deciling method)
and store the averages for the entire possible date range. The tables
have a structure of "date, decile1, decile2, decile3,...,decile10'.
Since there can be up to 528 combos, I generate the table on the fly
when it is first requested.
The client pulls up a web page, selects his criterion, the cgi-bin
program pulls the data from MySQL, graphs it with ChartDirector and he
gets back four pretty and complicated graphs.
Beleive it or not, it works well. OTOH, if I showed you the code, you'd
guys wouldn't let me attend the monthly meetings since the code is so
Well, the client wants to see more data, which means my tables are
going to get more unwieldy. So here's my crazy idea: instead of storing
the decile related data in the table, I create decile objects, probably
a HoH, and store the object in the table as a text field using the Storable
(And since I'm not using any SQL functionality, I can store this data in
text files but that will probably have to wait for version 2.0 or more
likeyl the next set of reports sine I don't get a chance to go back and
rewrite the prototype code.)
The more I think about this idea, the more I like it. So what's wrong
Linux New Jersey, Inc.
More information about the ABE-pm