SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Create a graph with pre-existing tabular data...


Create a graph with pre-existing tabular data...

Author
Message
tsims-1092079
tsims-1092079
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
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.


Attachments
Capture.JPG (7 views, 82.00 KB)
Mark Fitzgerald-331224
Mark Fitzgerald-331224
Hall of Fame
Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)

Group: General Forum Members
Points: 3875 Visits: 1538
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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search