dbTalk Databases Forums  

DistincSum?

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


Discuss DistincSum? in the microsoft.public.sqlserver.olap forum.



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

Default DistincSum? - 10-14-2004 , 05:16 PM






I have a fact table which describe the disease studentˇ¦s number of each
gender in grade,

There two measures, DisNum is the disease student numbers of each disease
like Fever and Cough, StNum is the student numbers of each gender in each
grade



Grade Gender Disease, [DisNum] [StNum]

----------------------------------------------------------------------------
---

1 M Fever 12 50

1 M Coughr 2 50

1 F Fever 13 60

1 F Cough 12 60

2 M Fever 11 55

2 M Cough 14 55

2 F Fever 25 53



When I roll up to grade, the DisNum is aggregated with sum, but the StNum
must sum with distinct Grade Like

Grade Gender Disease, [DisNum] [StNum] [DisRate]

----------------------------------------------------------------------------
---



1 49 50
49/110



1 M Fever 12 50

1 M Cough 2 50

1 F Fever 13 60

1 F Cough 12 60

2 50 108
50/108

2 M Fever 11 55

2 M Cough 14 55

2 F Fever 25 53



How can I do with the sum of [StNum]?





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

Default Re: DistincSum? - 10-14-2004 , 08:03 PM






Since [StNum] is not dependent on the [Disease] dimension, it should
ideally have a separate fact table, without the [Disease] column (a SQL
view would work for this purpose). Then 2 separate cubes could be built,
one with [DisNum] and the other with [StNum] measures. These 2 cubes
could be combined in a virtual cube with both measures.


- Deepak

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

Reply With Quote
  #3  
Old   
ad
 
Posts: n/a

Default Re: DistincSum? - 10-14-2004 , 10:36 PM



Thank very much,
Are there any example about virtual cube which combined from two cube?

"Deepak Puri" <deepak_puri (AT) progressive (DOT) com>
???????:uijNLLlsEHA.2300 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
Quote:
Since [StNum] is not dependent on the [Disease] dimension, it should
ideally have a separate fact table, without the [Disease] column (a SQL
view would work for this purpose). Then 2 separate cubes could be built,
one with [DisNum] and the other with [StNum] measures. These 2 cubes
could be combined in a virtual cube with both measures.


- Deepak

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



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

Default Re: DistincSum? - 10-15-2004 , 11:02 AM



The sample Foodmart database includes a Virtual Cube:
"Warehouse and Sales"

Here is some [MS] documentation on virtual cubes:

http://msdn.microsoft.com/library/de.../en-us/olapdma
d/agcubevarieties_7j8z.asp


- 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.