Cross-tab report: from list

mfstuart mfstuart at cox.net
Fri Jan 2 23:23:22 EST 2009


Hi all,

How do I manipulate the following data list into a spreadsheet (cross-tab
report) format?

I'm assuming arrays are in the works for this to build the spreadsheet data
set, 
but since I haven't worked with them, I'm not sure about that.

As you can see, the list contains repeating years and months for each year.
There can be many years, which are unknown before hand. Some of them not
consecutive in the list range. Same goes with the months.
So some kind of checking to see if the year has a complete 12 month list
would have to exist in the script logic.
Or maybe not.
The year and month names are in descending order in the list.

2009-January-109
2008-December-1009
2008-November-900
2008-October-1000
2008-September-1500
2008-August-800
2008-July-780
2008-June-950
2008-May-850
2008-April-1230
2008-March-1140
2008-February-1170
2008-January-1320
2007-December-900
etc
2007-January-1100
2006-December-950
etc
2006-January-1200
etc

So that the report appears as:

Month   2009  2008  2007  2006  2005 etc
January  109  1320  1100  1200   etc
February   0  1170   etc
March      0  1140   etc
April      0  1230   etc
May        0   850   etc
June       0   950   etc
July       0   780   etc
August     0   800   etc
September  0  1500   etc
October    0  1000   etc
November   0   900   etc
December   0  1009   etc
Totals: 2118 12649   etc

The 'etc' is just to note that the data continues in the actual report/list,
but for this purpose, it is to show formatting.

Regards,
Mark Stuart
-- 
View this message in context: http://www.nabble.com/Cross-tab-report%3A-from-list-tp21261951p21261951.html
Sent from the Revolution - User mailing list archive at Nabble.com.




More information about the use-livecode mailing list