Reputation: 449
I have a table setup with the following columns:
Product Name
SalesMonth1
SalesMonth2
SalesMonth3
SalesMonth4
SalesMonth5
An example of a row is as follows:
Bread
300
600
800
900
1000
I am trying to put this into a line graph in SSRS but am having trouble figuring out which fields go where. In my dataset, I have a field for each "SalesMonth" column. So in my dataset, I have 6 fields total including the product name. Will this work? On which axis should the product name go and the sales fields go?
Upvotes: 0
Views: 703
Reputation: 15027
I hope your dataset uses SQL.
I would "unpivot" the data by writing a 5-part UNION SELECT, e.g.
SELECT Product_Name , 1 AS Month , SalesMonth1 AS Sales
UNION ALL
SELECT Product_Name , 2 AS Month , SalesMonth2 AS Sales
UNION ALL
...
SELECT Product_Name , 5 AS Month , SalesMonth5 AS Sales
Then in the SSRS Chart definition:
Month = Category Group
Product Name = Series Group
Sales = Values
But the real real answer is that your data is probably not in a useful shape for reporting. Will there only ever be 5 months? I suspect not...
Upvotes: 1