dbTalk Databases Forums  

Cumulative sum and ratio with SQL 2005

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


Discuss Cumulative sum and ratio with SQL 2005 in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jéjé
 
Posts: n/a

Default Cumulative sum and ratio with SQL 2005 - 03-11-2006 , 02:35 PM






Hi,

I'm looking for a SQL 2005 query to do a running sum to do this:
I want to identify the first day when an employee reached 20% of absences.

I have 2 table:
Absences (by activity, day, employee...)
Activities (duration in days...)

so when an employee in 1 activity reached 20% of time lost I want the day
when this event appears.

I want an SQL 2005 version. does the new features in 2005 can provides good
results quickly?

also I have AS2005 cubes based on these tables.
I have tried MDX formula, but its too slow to be effective, so I'll preload
my cube from a view.
but maybe you have a magic MDX formula ;-)

the destination cube for this cumul will allow the user to know which
activity, who and when an employee reached the threshold value, also the
frequency etc...

thanks for your feedback.

Jerome.



Reply With Quote
  #2  
Old   
Simon Sabin
 
Posts: n/a

Default Re: Cumulative sum and ratio with SQL 2005 - 04-09-2006 , 02:49 AM






Unfortunately there isn't any way to do this in SQL 2005.
There have been some posts recently on how to do this.
http://www.sqljunkies.com/WebLog/sim...ggregates.aspx

MDX should provide a quick answer but I'm not an MDX person sorry

--
Simon Sabin
SQL Server MVP
http://sqljunkies.com/weblog/simons

"Jéjé" <willgart (AT) BBBhotmailAAA (DOT) com> wrote

Quote:
Hi,

I'm looking for a SQL 2005 query to do a running sum to do this:
I want to identify the first day when an employee reached 20% of absences.

I have 2 table:
Absences (by activity, day, employee...)
Activities (duration in days...)

so when an employee in 1 activity reached 20% of time lost I want the day
when this event appears.

I want an SQL 2005 version. does the new features in 2005 can provides
good results quickly?

also I have AS2005 cubes based on these tables.
I have tried MDX formula, but its too slow to be effective, so I'll
preload my cube from a view.
but maybe you have a magic MDX formula ;-)

the destination cube for this cumul will allow the user to know which
activity, who and when an employee reached the threshold value, also the
frequency etc...

thanks for your feedback.

Jerome.





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.