I am trying to caculate the percentage and add it to my cube measure.
Basicaly i am trying to calculate the percentage of sales Week 01 to 02 Waiting Times 03 to 04 Waiting Times | | 99 to 100 Waiting Times
The formula to calculate the percentage is SUM(sum of all the amount up to 17 to 18 Waiting Times) / SUM(Sum of amount for the all the Waiting Times)
Can some one help me with the mdx to achive SUM(sum of all the amount up to 17 to 18 weeks) .
I tried the below. But the problem is , the numarator [Waiting Times].[Wait].&[17 To 18 Weeks] is just giving me the amount for that week. I need the sum of amount up to 17 to 18 [Waiting Times].
CREATE
MEMBER CurrentCube.[Measures].[Percent of Performance] AS
CASE
WHEN
IsEmpty([Measures].[Patients])
THEN NULL
ELSE
(
[Waiting Times].[Wait].&[17 To 18 Weeks]
,[Measures].[Patients]
)
/
(
[Waiting Times].[Wait].[All]
,[Measures].[Amount]
)