All,
I am trying to create a Line chart that has time across the x axis, and several metric values for the y axis for a single object. I would like to have a chart that shows a line for points, a line for rebounds, another line for steals and another line for assists for a particular player for each month of the 2015 season. I have tried this query, but it is not working. It seems to group incorrectly:
<<<<<<<<<<<<<<START SQL>>>>>>>>>>>>>>>>>>>>>>>>>
DROP PROCEDURE IF EXISTS sp_DBR_PlayerStats
$$
CREATE PROCEDURE `sp_DBR_PlayerStats`(p_player varchar(30), inStartDate datetime, inEndDate datetime)
BEGIN
select 'dbr.title', 'Player Stats';
select 'dbr.refresh', 50;
SELECT 'dbr.chart', 'MSline', '';
select 'dbr.chart.options', 'rotateNames', 45;
select 'dbr.chart.options', 'axis', 'Time', 'Points', 'Rebounds', 'Steals', 'Assists';
select 'dbr.chart.options', 'datetimescale', 1;
select 'dbr.parameters.show';
SELECT MONTH(GameDate) as 'Month',
avg(Points) as 'Points',
avg(Rebounds) as 'Rebounds',
avg(Steals) as 'Steals',
avg(Assists) as 'Assists'
FROM playerstats
WHERE playername like concat('%',p_player,'%')
AND YEAR(GameDate)=2015
GROUP BY GameDate;
END
$$
<<<<<<<<<<<<<<<<Finish SQL>>>>>>>>>>>>>>>>>>>
Can anyone assist?