dbTalk Databases Forums  

Average over time

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


Discuss Average over time in the microsoft.public.sqlserver.olap forum.



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

Default Average over time - 05-11-2006 , 02:11 PM






I have a fact table that lists each employee in the company on the last day
of the month. The dimensions are the day of the month and the employee. With
each record I bring in a value for the active and terminated employees of 0
or 1 for each. When I view this a month at a time, it gives me a count of how
many active employees I have at the end of the month and how many
terminations to that I can then calculate the turnover percentage. When I
roll it up into quarters and years, however, I want the activeemployee
measure to be an average of the individual month counts. How can this be done?

Reply With Quote
  #2  
Old   
Tim Dot NoSpam
 
Posts: n/a

Default Re: Average over time - 05-15-2006 , 05:41 AM






You could create a DistinctCount measure based on the Employee key (use
column binding) in the fact table and then filter the count by active..

( [Employee].[ActiveInactive].[1], [Measures].[Employee Count] ) /
[Measures].[Employee Count]

I'm assuming you also populate the rest of the month in the fact table with
NULLs so your measures don't get skewed.



"Bryan Wheeler" <BryanWheeler (AT) discussions (DOT) microsoft.com> wrote

Quote:
I have a fact table that lists each employee in the company on the last day
of the month. The dimensions are the day of the month and the employee.
With
each record I bring in a value for the active and terminated employees of
0
or 1 for each. When I view this a month at a time, it gives me a count of
how
many active employees I have at the end of the month and how many
terminations to that I can then calculate the turnover percentage. When I
roll it up into quarters and years, however, I want the activeemployee
measure to be an average of the individual month counts. How can this be
done?



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.