I'm trying to create a stacked bar chart using raw data coming from a MySQL server. The result coming back from one query is:
{{SQLDateTime[{2011, 7, 23, 13, 0, 0.}], 74},
{SQLDateTime[{2011, 8, 11, 15, 35, 54.}], 1},
{SQLDateTime[{2011, 8, 18, 9, 28, 14.}], 49},
{SQLDateTime[{2011, 8, 24, 21, 45, 29.}], 1},
{SQLDateTime[{2011, 8, 31, 10, 0, 18.}], 1},
{SQLDateTime[{2011, 9, 8, 10, 6, 45.}], 5},
{SQLDateTime[{2011, 9, 14, 9, 35, 40.}], 10},
{SQLDateTime[{2011, 9, 15, 6, 27, 12.}], 1},
{SQLDateTime[{2011, 9, 21, 9, 47, 26.}], 6},
{SQLDateTime[{2011, 9, 29, 10, 5, 2.}], 3},
{SQLDateTime[{2011, 10, 6, 9, 34, 26.}], 3},
{SQLDateTime[{2011, 10, 24, 9, 31, 42.}], 1},
{SQLDateTime[{2011, 10, 27, 9, 52, 7.}], 2},
{SQLDateTime[{2011, 11, 25, 10, 53, 27.}], 2},
{SQLDateTime[{2011, 12, 1, 11, 0, 21.}], 3},
{SQLDateTime[{2011, 12, 6, 10, 49, 42.}], 3},
{SQLDateTime[{2011, 12, 8, 14, 38, 54.}], 1},
{SQLDateTime[{2012, 3, 27, 8, 10, 31.}], 1}}
I'm going to get ten similar sets of results. The difference will be that they don't contain all of the same dates. I need to create a matrix like so:
The first row is a list of dates. Each result set will contain different dates and some will be the same and some not, think of this first row as a list of unique dates pooled together from all result sets. Should be ordered chronologically.
Row number two lists the correponding values in each column. Look at my example result set above. Each date has a value corresponding to it. All of these values make up a row, with each element under its corresponding date. There will be dates in the first row for which there are no corresponding values in this particular result set, these elements should be zero.
There will be one row for each result set plus the top row consisting of dates.
How can I do this?