Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Create a graph with pre-existing tabular data... Expand / Collapse
Author
Message
Posted Wednesday, September 25, 2013 10:36 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, December 5, 2013 1:20 PM
Points: 1, Visits: 14
I have a dataset generated in SQL Server that already returns tabular data. The columns are simply year, jan, feb, mar, ... with the data simply the number of units sold each month. I am having much more difficulty than I anticipated getting the correct line graph. I have tried multiple variations using the category and group settings in the chart data. If I take the data to Excel, I can get the result with no issues. A sample of the dataset being returned from SQL and the chart I am trying to create are shown below. Any help is greatly appreciated.



  Post Attachments 
Capture.JPG (4 views, 82.40 KB)
Post #1498481
Posted Wednesday, September 25, 2013 11:42 AM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: 2 days ago @ 3:14 PM
Points: 3,143, Visits: 1,366
It comes down to the data you have for the chart in SSRS to work on. Having the data in a denormalised format (jan, feb, mar etc) means that the chart does not have a single column that holds the value to represent. If the query was to be in a normalised format then the chart would be easy.

Get the query output the data as shown below.

Year | MonthName | MonthNumber | ValueToShow

Create a chart and set the value as value to show and the category as MonthNumber. Add the year to the series. Change the category label to MonthName, this will order the x values by MonthNumber but show the MonthName.

Fitz
Post #1498515
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse