dbTalk Databases Forums  

AVG Help

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


Discuss AVG Help in the microsoft.public.sqlserver.olap forum.



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

Default AVG Help - 12-07-2004 , 06:53 PM






I have spend parts of 3 days trying to determine what I am doing wrong or if
this is possible. I am attempting what I would think to be simple. I have a
cube hosptial discharges with a length of stay and am trying to compute the
average length of stay for a period of time. The returned value is not an
average and I can't understand what values are being used to compute the
returned value. Searches on the web indicate I should use descendants
function.

What an I missing?

Avg((descendants([DischargeDt].currentmember,[day])),[Measures].[Los])

TIA - Ron



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

Default Re: AVG Help - 12-07-2004 , 10:19 PM






Depends on how you defined [Measures].[Los] in your cube - is it a base
measure with a 'Sum' aggregation function? Or is it a calculated
measure, and how does it work? Also, do you really want an unwighted
average across all days (ie. regardless of how many discharges occurred
on each day)?


- Deepak

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

Reply With Quote
  #3  
Old   
Ron Schmidt
 
Posts: n/a

Default Re: AVG Help - 12-08-2004 , 08:49 AM



Thanks for the response.

It is a base measure (not calculated) and is a 'sum'. Yes, I will need to
perform other averages, but I need to get the simple average working first.

Ron

"Deepak Puri" <deepak_puri (AT) progressive (DOT) com> wrote

Quote:
Depends on how you defined [Measures].[Los] in your cube - is it a base
measure with a 'Sum' aggregation function? Or is it a calculated
measure, and how does it work? Also, do you really want an unwighted
average across all days (ie. regardless of how many discharges occurred
on each day)?


- 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: AVG Help - 12-08-2004 , 02:54 PM



A simple average is often computed in MS OLAP by defining a "count" base
measure, which divides the "sum" measure:

http://groups-beta.google.com/group/...rver.olap/brow
se_frm/thread/3e5022ea425ca822/6e9d73404113dfa0?q=average+sum%2Fcount&_d
one=%2Fgroup%2Fmicrosoft.public.sqlserver.olap%2Fs earch%3Fgroup%3Dmicros
oft.public.sqlserver.olap%26q%3Daverage+sum%2Fcoun t%26qt_g%3D1%26searchn
ow%3DSearch+this+group%26&_doneTitle=Back+to+Searc h&&d#6e9d73404113dfa0
Quote:
Sean Boon [MS] Jul 14 2003, 10:56 am show options

Newsgroups: microsoft.public.sqlserver.olap
From: "Sean Boon [MS]" <seanb... (AT) online (DOT) microsoft.com>
Date: Mon, 14 Jul 2003 10:55:54 -0700
Local: Mon, Jul 14 2003 10:55 am
Subject: Re: avg
Reply | Reply to Author | Forward | Print | Individual Message | Show
original | Report Abuse

If you want to create an average, what you need to do is create one
measure
called SUM, and another measure based on COUNT and then create a
calculated
member called AVG which would just be SUM/COUNT. I believe there are
examples of this in the Foodmart 2000 cubes.


Sean


--
Sean Boon
SQL Server BI Product Unit
Quote:

- Deepak

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


Reply With Quote
  #5  
Old   
Ron Schmidt
 
Posts: n/a

Default Re: AVG Help - 12-09-2004 , 05:55 PM



Thanks again for the reply. I have both the SUM and Count so I will work
with those for now and revisit the AVG when I feel ready for another
challenge -- Ron


"Deepak Puri" <deepak_puri (AT) progressive (DOT) com> wrote

Quote:
A simple average is often computed in MS OLAP by defining a "count" base
measure, which divides the "sum" measure:

http://groups-beta.google.com/group/...rver.olap/brow
se_frm/thread/3e5022ea425ca822/6e9d73404113dfa0?q=average+sum%2Fcount&_d
one=%2Fgroup%2Fmicrosoft.public.sqlserver.olap%2Fs earch%3Fgroup%3Dmicros
oft.public.sqlserver.olap%26q%3Daverage+sum%2Fcoun t%26qt_g%3D1%26searchn
ow%3DSearch+this+group%26&_doneTitle=Back+to+Searc h&&d#6e9d73404113dfa0

Sean Boon [MS] Jul 14 2003, 10:56 am show options

Newsgroups: microsoft.public.sqlserver.olap
From: "Sean Boon [MS]" <seanb... (AT) online (DOT) microsoft.com
Date: Mon, 14 Jul 2003 10:55:54 -0700
Local: Mon, Jul 14 2003 10:55 am
Subject: Re: avg
Reply | Reply to Author | Forward | Print | Individual Message | Show
original | Report Abuse

If you want to create an average, what you need to do is create one
measure
called SUM, and another measure based on COUNT and then create a
calculated
member called AVG which would just be SUM/COUNT. I believe there are
examples of this in the Foodmart 2000 cubes.


Sean


--
Sean Boon
SQL Server BI Product Unit



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