dbTalk Databases Forums  

Custom Aggregations for Measure

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


Discuss Custom Aggregations for Measure in the microsoft.public.sqlserver.olap forum.



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

Default Custom Aggregations for Measure - 07-20-2006 , 11:22 AM






I have the following Hierarchy:
BU
DEPT (contains columns DEPTID, DeptName, TargetType, TargetPeriod)

The TargetTypes are ('S-Sum, A-Average, L-Latest).
The TargetPeriod is (D-Daily, M-Monthly).
Idea is that If the Type is "S", and the Period is "D", then the Target is
simply summed over the period. Monthly is more complex, requiring me to
divide the amount over the days of the month to get a daily average.

I have a fact table (Targets) (columns are DEPTID, Date, Target)

The default AggregateFunction (Min, Avg, Sum, etc) won't work for me.

How do I start this to write a custom aggregation? My assumption is that I
would need some type of Case statement.

Wondering if someone can get me started with some skeleton code...


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.