dbTalk Databases Forums  

Dimension from different columns of fact table?

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


Discuss Dimension from different columns of fact table? in the microsoft.public.sqlserver.olap forum.



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

Default Dimension from different columns of fact table? - 11-14-2004 , 09:30 PM






Hi,
Following is the scenario. A customer makes a phone call and
requests about three services provided by our company. This
information is stored in the fact table in one row. The fact table
looks like

[(Call ID);(Date);(Svc 1);(Svc 2);(Svc 3)].

"Svc" columns will have 1 or 0 depending upon whether the customer
requested for that service in that particular call.

If the fact table contains two rows with
1) one customer asking for service 1 and service 3
2) second customer asking for all three services
how can i create a service dimension so that I can create output like

"Services"-----"No of calls"
-----------------------------
"Svc 1" ------- 2
"Svc 2" ------- 1
"Svc 3" ------- 2

Thanks
Kri

Reply With Quote
  #2  
Old   
Deepak Puri
 
Posts: n/a

Default Re: Dimension from different columns of fact table? - 11-15-2004 , 12:30 AM






One approach is to "pivot" the fact table, so that there is one record
per service handled in a call. So, call#1 would result in 2 records,
whereas call#2 would have 3 records.

The pivoted fact table would have CallID, Date and Svc columns, where a
"Service" dimension would join to "Svc".
So the 5 resultant records would have field values like:

Call1/Svc1; Call1/Svc3; Call2/Svc1; Call2/Svc2; Call2/Svc3


- Deepak

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

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.