Grouping Data using

khigoth

New Member
i am drawing a blank on this one and need some help. I have a database with metrics and I am trying to create a line chart. It involves grouping, or merging, the records based on the ID of the metric so I can then loop over and then do a sub loop on the values to generate the XML to produce the chart using PHP.For example my recordset:\[code\]MetricID, Metric Name, Quarter, Year, Value1 Total Calls 1 2011-01-01 22403.001 Total Calls 2 2011-01-01 22366.001 Total Calls 3 2011-01-01 34456.001 Total Calls 4 2011-01-01 36456.001 Total Calls 1 2012-01-01 38456.001 Total Calls 2 2012-01-01 33256.001 Total Calls 3 2012-01-01 35456.001 Total Calls 4 2012-01-01 30456.002 Total Referrals 1 2011-01-01 9668.002 Total Referrals 2 2011-01-01 9154.002 Total Referrals 3 2011-01-01 10445.00,2 Total Referrals 4 2011-01-01 12445.002 Total Referrals 1 2012-01-01 12845.002 Total Referrals 2 2012-01-01 10145.002 Total Referrals 3 2012-01-01 10445.002 Total Referrals 4 2012-01-01 12445.00\[/code\]I need to loop over first the Total Calls to do a sub loop for the values, then loop over the Total Referrals, doing a sub loop of its values. Since the list is variable, I never know how many distince metric IDs I might get, 1 to 4.Thanks!
 
Back
Top