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