dbTalk Databases Forums  

Any suggestions on a vexing data problem?

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Any suggestions on a vexing data problem? in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tom
 
Posts: n/a

Default Any suggestions on a vexing data problem? - 09-25-2006 , 12:26 PM






Here's the issue...

We're running SQL Server 2005 w/ all services.
We have a table called 'PartProduct' which has 3 columns: PartNumber,
PartQty, and Product. The combination of PartNumber+Product is the key;
a PartNumber can appear on many products, and a Product has many
PartNumbers.

I can create a cube which shows me a pivottable with PartNumbers down
the Y axis and Products across the X axis, so that I can compare how
many of each Part is used on each Product. What I NEED, though, is a
comparison how many Parts each Product has in common, whether by the
number of different parts or the sum of different parts:

Source Table:
PartNo PartQty Product
------ ------- -------
PartA 4.0 ProductA
PartA 3.0 ProductB
PartA 4.0 ProductC
PartB 1.0 ProductA
PartB 1.0 ProductB
PartB 1.0 ProductC
PartC .5 ProductB
PartC .5 ProductA

PivotTable from a cube I've created:
PartNo ProductA ProductB ProductC
------ -------- -------- --------
PartA 4.0 3.0 4.0
PartB 1.0 1.0 1.0
PartC .5 .5

What I need (#1 - total parts used between a pair of products)
(Note that where a product crosses itself, the number of parts is
doubled, since it's a pair of products):

Product ProductA ProductB ProductC
------- -------- -------- --------
ProductA 11.0 10.0 10.5
ProductB 10.0 9.0 9.5
ProductC 10.5 9.5 10.0

What I need (#2 - Number of different PartNos in a pair of products):

Product ProductA ProductB ProductC
------- -------- -------- --------
ProductA 3 3 2
ProductB 3 3 2
ProductC 2 2 2

I need a few other stats, but I think if someone can help me figure out
how to generate these two tables, I can figure out the rest.

Any suggestions are DEEPLY appreciated. I'm an Analysis Services
neophyte and I'm learning as fast as I can.

Thanks, all!

- Tom


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.