Percentage Calculation on MDX
Im new to MDX Query and I'm trying to add a percentage on attended percentage in each row. The following code :
SELECT {[Measures].[Client Interventions Count]* [Dim Intervention Attendance].[Attended].Children} ON COLUMNS,
[Dim Date].[Calendar].[Month Name] ON ROWS
FRO开发者_如何学运维M [Client Intervention]
procude a result of :
How can I perform a calculation on each row? For example, first row November 2007 , total client intervention count = 68 , so the percentage count should be 57/68 %
Any idea?? Thanks
Use a calculated member - you can find several examples here. The idea for the query is as following:
WITH MEMBER [Dim Intervention Attendance].[Attended].[%] AS
( [Dim Intervention Attendance].[Attended].[Attented],
[Measures].[Client Interventions Count] )
/ ( [Dim Intervention Attendance].[Attended].[Not Attented],
[Measures].[Client Interventions Count] )
SELECT
[Measures].[Client Interventions Count]
* { [Dim Intervention Attendance].[Attended].[%],
[Dim Intervention Attendance].[Attended].Children } ON COLUMNS,
[Dim Date].[Calendar].[Month Name] ON ROWS
FROM [Client Intervention
]
精彩评论