Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Kind of 3 dimensional report

Author  Topic 

rtutus
Aged Yak Warrior

522 Posts

Posted - 2007-10-29 : 16:42:21
Need: I need a Kind of 3 dimensional report (not sure if it s the right term)

Hi,

I have category, Products and sales data.

I want a report that displays products and categories, grouped by categoriy ID. Each category of each group has a number of products.

Here is the challenge:
I want the report to include several months, for january for example: I need the categories and their sub products and for each group I want the total sales of each product for September.

I also want the same thing for February, March....etc all in the same report on different columns.

Something like this:

Category Product Jan Feb Mar..etc
Category1 Product11 xxxxx xxxxx xxxx
............. Product12 xxxxx xxxxx xxxx
............. Product13 xxxxx xxxxx xxxx
Category2
............. Product21 xxxxx xxxxx xxxx
............. Product22 xxxxx xxxxx xxxx
............. Product23 xxxxx xxxxx xxxx
Category3
............. Product31 xxxxx xxxxx xxxx
............. Product32 xxxxx xxxxx xxxx
............. Product33 xxxxx xxxxx xxxx

Pls note that I have my data pretty much in the same table.

Thanks a lot.

tm
Posting Yak Master

160 Posts

Posted - 2007-10-29 : 16:48:55
Is it a pivot table you want?

Check out Books on line >> "pivot".
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-10-30 : 02:14:26
quote:
Originally posted by rtutus

Need: I need a Kind of 3 dimensional report (not sure if it s the right term)

Hi,

I have category, Products and sales data.

I want a report that displays products and categories, grouped by categoriy ID. Each category of each group has a number of products.

Here is the challenge:
I want the report to include several months, for january for example: I need the categories and their sub products and for each group I want the total sales of each product for September.

I also want the same thing for February, March....etc all in the same report on different columns.

Something like this:

Category Product Jan Feb Mar..etc
Category1 Product11 xxxxx xxxxx xxxx
............. Product12 xxxxx xxxxx xxxx
............. Product13 xxxxx xxxxx xxxx
Category2
............. Product21 xxxxx xxxxx xxxx
............. Product22 xxxxx xxxxx xxxx
............. Product23 xxxxx xxxxx xxxx
Category3
............. Product31 xxxxx xxxxx xxxx
............. Product32 xxxxx xxxxx xxxx
............. Product33 xxxxx xxxxx xxxx

Pls note that I have my data pretty much in the same table.

Thanks a lot.



Dont you think you should produce this result in Reports?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-10-30 : 11:34:43
Post your table DDL, sample data & required result


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -