dbTalk Databases Forums  

STDEV aggregate from fact table

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


Discuss STDEV aggregate from fact table in the microsoft.public.sqlserver.olap forum.



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

Default STDEV aggregate from fact table - 12-14-2004 , 03:13 PM






I am designing a quality control cube where I need to compute the standard
dev from the fact table information. The only way I have found to do this
is to precompute X^2 (so that I can roll up the squares of the measurements)
then I use a calculated member stdev.

Is there a better way to perform this type of computation with AS? My main
concern is that I am required to double the columns (measurement then
measurement squared) in the fact table.

Thanks (in advance!)

Bill



Reply With Quote
  #2  
Old   
Peter Yang [MSFT]
 
Posts: n/a

Default RE: STDEV aggregate from fact table - 12-14-2004 , 11:15 PM






Hello Bill,

I am not quite sure about how you want to calculate stdev. Will you
describe it in more details:

Assuming that you always wish to calculate the standard deviation of
measure1 for all the leaf nodes under a selected member of the
[dimension1] dimension:

Stdev(Descendants([demension1].CurrentMember,,LEAVES),
[Measures].[measure1])

Have a great day!

Thanks & Regards,

Peter Yang
MCSE2000, MCSA, MCDBA
Microsoft Partner Online Support

Get Secure! - www.microsoft.com/security

================================================== ===
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from your issue.
================================================== ===
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
Quote:
From: "Bill Hays" <bhays (AT) comtime (DOT) com
Subject: STDEV aggregate from fact table
Date: Tue, 14 Dec 2004 16:13:04 -0500
Lines: 14
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
Message-ID: <eAcFDHi4EHA.1260 (AT) TK2MSFTNGP12 (DOT) phx.gbl
Newsgroups: microsoft.public.sqlserver.olap
NNTP-Posting-Host: proxy2.comtime.com 68.75.195.7
Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFT NGP08.phx.gbl!TK2MSFTNGP12
.phx.gbl
Quote:
Xref: cpmsftngxa10.phx.gbl microsoft.public.sqlserver.olap:55805
X-Tomcat-NG: microsoft.public.sqlserver.olap

I am designing a quality control cube where I need to compute the standard
dev from the fact table information. The only way I have found to do this
is to precompute X^2 (so that I can roll up the squares of the
measurements)
then I use a calculated member stdev.

Is there a better way to perform this type of computation with AS? My
main
concern is that I am required to double the columns (measurement then
measurement squared) in the fact table.

Thanks (in advance!)

Bill





Reply With Quote
  #3  
Old   
Bill Hays
 
Posts: n/a

Default Re: STDEV aggregate from fact table - 12-15-2004 , 09:28 AM



Thanks for the response! This is a tricky issue, takes a moment for me to
wrap my mind around the issue also.

My problem, (I am almost sure there isn't an AS solution now) is that I am
trying to calculate the standard deviation from the facts, not from the
leaves. In many data collection areas there are just too many fact records,
for example 100k/day.
I would prefer to aggregate these into useful blocks of 1 hour of
production/product/machine. But in doing so, I loose the ability to
compute the Stdev back down to the fact table. Once the data is SUMed with
the Aggregate function, the information is lost.

I could make each fact it's own leaf, as you suggest, but 100k leaves would
take some time to compute the stdev for just a single day of production.
(over a couple of months or a year this looks really ugly)

Looks like the best solution is still to pre-compute the squares of my
measures and then create a calculated member for the StDev using the rollup
sum of the measures and measures squared.

Bill



"Peter Yang [MSFT]" <petery (AT) online (DOT) microsoft.com> wrote

Quote:
Hello Bill,

I am not quite sure about how you want to calculate stdev. Will you
describe it in more details:

Assuming that you always wish to calculate the standard deviation of
measure1 for all the leaf nodes under a selected member of the
[dimension1] dimension:

Stdev(Descendants([demension1].CurrentMember,,LEAVES),
[Measures].[measure1])

Have a great day!

Thanks & Regards,

Peter Yang
MCSE2000, MCSA, MCDBA
Microsoft Partner Online Support

Get Secure! - www.microsoft.com/security

================================================== ===
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from your issue.
================================================== ===
This posting is provided "AS IS" with no warranties, and confers no
rights.


--------------------
| From: "Bill Hays" <bhays (AT) comtime (DOT) com
| Subject: STDEV aggregate from fact table
| Date: Tue, 14 Dec 2004 16:13:04 -0500
| Lines: 14
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
| Message-ID: <eAcFDHi4EHA.1260 (AT) TK2MSFTNGP12 (DOT) phx.gbl
| Newsgroups: microsoft.public.sqlserver.olap
| NNTP-Posting-Host: proxy2.comtime.com 68.75.195.7
| Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFT NGP08.phx.gbl!TK2MSFTNGP12
phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.sqlserver.olap:55805
| X-Tomcat-NG: microsoft.public.sqlserver.olap
|
| I am designing a quality control cube where I need to compute the
standard
| dev from the fact table information. The only way I have found to do
this
| is to precompute X^2 (so that I can roll up the squares of the
measurements)
| then I use a calculated member stdev.
|
| Is there a better way to perform this type of computation with AS? My
main
| concern is that I am required to double the columns (measurement then
| measurement squared) in the fact table.
|
| Thanks (in advance!)
|
| Bill
|
|
|




Reply With Quote
  #4  
Old   
Peter Yang [MSFT]
 
Posts: n/a

Default Re: STDEV aggregate from fact table - 12-16-2004 , 12:16 AM



Hello Bill,

Based on the current situation, I agree with you this might be the only
solution at present. :-)

Thanks & Regards,

Peter Yang
MCSE2000, MCSA, MCDBA
Microsoft Partner Online Support

Get Secure! - www.microsoft.com/security

================================================== ===
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from your issue.
================================================== ===
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
Quote:
From: "Bill Hays" <bhays (AT) comtime (DOT) com
References: <eAcFDHi4EHA.1260 (AT) TK2MSFTNGP12 (DOT) phx.gbl
6aH3kUm4EHA.3512 (AT) cpmsftngxa10 (DOT) phx.gbl
Subject: Re: STDEV aggregate from fact table
Date: Wed, 15 Dec 2004 10:28:25 -0500
Lines: 97
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Message-ID: <eaHrPrr4EHA.1292 (AT) TK2MSFTNGP10 (DOT) phx.gbl
Newsgroups: microsoft.public.sqlserver.olap
NNTP-Posting-Host: 65.185.80.189
Path:
cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFT NGP08.phx.gbl!TK2MSFTNGP10
phx.gbl
Quote:
Xref: cpmsftngxa10.phx.gbl microsoft.public.sqlserver.olap:55844
X-Tomcat-NG: microsoft.public.sqlserver.olap

Thanks for the response! This is a tricky issue, takes a moment for me
to
wrap my mind around the issue also.

My problem, (I am almost sure there isn't an AS solution now) is that I
am
trying to calculate the standard deviation from the facts, not from the
leaves. In many data collection areas there are just too many fact
records,
for example 100k/day.
I would prefer to aggregate these into useful blocks of 1 hour of
production/product/machine. But in doing so, I loose the ability to
compute the Stdev back down to the fact table. Once the data is SUMed
with
the Aggregate function, the information is lost.

I could make each fact it's own leaf, as you suggest, but 100k leaves
would
take some time to compute the stdev for just a single day of production.
(over a couple of months or a year this looks really ugly)

Looks like the best solution is still to pre-compute the squares of my
measures and then create a calculated member for the StDev using the
rollup
sum of the measures and measures squared.

Bill



"Peter Yang [MSFT]" <petery (AT) online (DOT) microsoft.com> wrote in message
news:6aH3kUm4EHA.3512 (AT) cpmsftngxa10 (DOT) phx.gbl...
Hello Bill,

I am not quite sure about how you want to calculate stdev. Will you
describe it in more details:

Assuming that you always wish to calculate the standard deviation of
measure1 for all the leaf nodes under a selected member of the
[dimension1] dimension:

Stdev(Descendants([demension1].CurrentMember,,LEAVES),
[Measures].[measure1])

Have a great day!

Thanks & Regards,

Peter Yang
MCSE2000, MCSA, MCDBA
Microsoft Partner Online Support

Get Secure! - www.microsoft.com/security

================================================== ===
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from your issue.
================================================== ===
This posting is provided "AS IS" with no warranties, and confers no
rights.


--------------------
| From: "Bill Hays" <bhays (AT) comtime (DOT) com
| Subject: STDEV aggregate from fact table
| Date: Tue, 14 Dec 2004 16:13:04 -0500
| Lines: 14
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
| Message-ID: <eAcFDHi4EHA.1260 (AT) TK2MSFTNGP12 (DOT) phx.gbl
| Newsgroups: microsoft.public.sqlserver.olap
| NNTP-Posting-Host: proxy2.comtime.com 68.75.195.7
| Path:

cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFT NGP08.phx.gbl!TK2MSFTNGP12
phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.sqlserver.olap:55805
| X-Tomcat-NG: microsoft.public.sqlserver.olap
|
| I am designing a quality control cube where I need to compute the
standard
| dev from the fact table information. The only way I have found to do
this
| is to precompute X^2 (so that I can roll up the squares of the
measurements)
| then I use a calculated member stdev.
|
| Is there a better way to perform this type of computation with AS? My
main
| concern is that I am required to double the columns (measurement then
| measurement squared) in the fact table.
|
| Thanks (in advance!)
|
| Bill
|
|
|






Reply With Quote
  #5  
Old   
willie
 
Posts: n/a

Default Re: STDEV aggregate from fact table - 12-20-2004 , 07:12 AM



Quote:
Looks like the best solution is still to pre-compute the squares of my
measures and then create a calculated member for the StDev using the
rollup sum of the measures and measures squared.
My main concern is that I am required to double the columns (measurement
then measurement squared) in the fact table.
You've likely already thought of this: instead of storing pre-calculated X^2
values in your fact table, you can of course use a calculated column in your
database, so it won't take up any extra storage space, instead X^2 is
calculated on the fly by your database.

Cheers/K







Reply With Quote
  #6  
Old   
Bill Hays
 
Posts: n/a

Default Re: STDEV aggregate from fact table - 12-20-2004 , 12:42 PM



Yes, once I figured out the pre-squaring, I changed my fact table over to a
view and added columns with squares, which seemed to work out very well.

Thanks for the suggestion.

Bill


"willie" <nexus42 (AT) btinternet (DOT) com> wrote

Quote:
Looks like the best solution is still to pre-compute the squares of my
measures and then create a calculated member for the StDev using the
rollup sum of the measures and measures squared.
My main concern is that I am required to double the columns (measurement
then measurement squared) in the fact table.

You've likely already thought of this: instead of storing pre-calculated
X^2
values in your fact table, you can of course use a calculated column in
your
database, so it won't take up any extra storage space, instead X^2 is
calculated on the fly by your database.

Cheers/K








Reply With Quote
  #7  
Old   
Peter Yang [MSFT]
 
Posts: n/a

Default Re: STDEV aggregate from fact table - 12-20-2004 , 07:24 PM



Hello Bill,

Glad to hear the issue is resolved! :-)

Thanks & Regards,

Peter Yang
MCSE2000, MCSA, MCDBA
Microsoft Partner Online Support

Get Secure! - www.microsoft.com/security

================================================== ===
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from your issue.
================================================== ===
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
Quote:
From: "Bill Hays" <bhays (AT) comtime (DOT) com
References: <eAcFDHi4EHA.1260 (AT) TK2MSFTNGP12 (DOT) phx.gbl
6aH3kUm4EHA.3512 (AT) cpmsftngxa10 (DOT) phx.gbl
<eaHrPrr4EHA.1292 (AT) TK2MSFTNGP10 (DOT) phx.gbl>
<0o9BYbz4EHA.3152 (AT) cpmsftngxa10 (DOT) phx.gbl> <cq6j3o$nhn$1 (AT) sparta (DOT) btinternet.com>
Quote:
Subject: Re: STDEV aggregate from fact table
Date: Mon, 20 Dec 2004 13:42:36 -0500
Lines: 31
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
Message-ID: <OUip#Os5EHA.2568 (AT) TK2MSFTNGP11 (DOT) phx.gbl
Newsgroups: microsoft.public.sqlserver.olap
NNTP-Posting-Host: proxy2.comtime.com 68.75.195.7
Path:
cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFT NGP08.phx.gbl!TK2MSFTNGP11
phx.gbl
Quote:
Xref: cpmsftngxa10.phx.gbl microsoft.public.sqlserver.olap:55960
X-Tomcat-NG: microsoft.public.sqlserver.olap

Yes, once I figured out the pre-squaring, I changed my fact table over to
a
view and added columns with squares, which seemed to work out very well.

Thanks for the suggestion.

Bill


"willie" <nexus42 (AT) btinternet (DOT) com> wrote in message
news:cq6j3o$nhn$1 (AT) sparta (DOT) btinternet.com...
Looks like the best solution is still to pre-compute the squares of my
measures and then create a calculated member for the StDev using the
rollup sum of the measures and measures squared.
My main concern is that I am required to double the columns
(measurement
then measurement squared) in the fact table.

You've likely already thought of this: instead of storing pre-calculated
X^2
values in your fact table, you can of course use a calculated column in
your
database, so it won't take up any extra storage space, instead X^2 is
calculated on the fly by your database.

Cheers/K










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.