MDX Help Needed-Urgent -
05-15-2006
, 10:57 AM
Hi,
I have a problem. Following is my fact(example).
id Product ProductSubType ModifiedDate RefDate
IdleTime (calc member)
================================================== ==========
1 P1 SP1 13-Jan-2006
15-May-2006 121days
2 P1 SP2 13-Jan-2006
15-May-2006 121days
3 P1 SP3 14-Jan-2006
15-May-2006 120
4 P2 SP4 15-Jan-2006
15-May-2006 119
5 P2 SP5 16-Jan-2006
15-May-2006 118
6 P3 SP6 17-Jan-2006
15-May-2006 117
7 P3 SP7 18-Jan-2006
15-May-2006 116
IdleTime (CalC Member) in days is RefDate - ModifiedDate in days.
Aggregation will be on idle time. i.e For example , For P1 , Idle Time
will be 121+121+120 days
For P3 117+116.
Now the problem is Idle time need to be calc member , Where
ModifiedDate and RefDate are NOT Time dimensions(There is one more time
dimension for this fact which is not mentioned). Thats why I thaught I
will have two more columns ModifiedDateinMins, RefDateInMins which will
be numeric columns calculated in Minutess with some base
date(ex:1-1-1900). .
Thus I can use those columns as measures for calculating datediff(We
can diff the column values and convert them to days). Now the problem
is this datediff should happen on every fact records under specified
rollup. i.e for P1 rollup , idle time should be calculated for first
three records and then aggregated. similarily for P3 idle time should
be calculated for last two rows and aggregated.
Please help me with MDX for it. .... |