我是MDX查询的新手,我正在尝试在每行中添加百分比。以下代码:
SELECT {[Measures].[Client Interventions Count]* [Dim Intervention Attendance].[Attended].Children} ON COLUMNS,
[Dim Date].[Calendar].[Month Name] ON ROWS
FROM [Client Intervention]
获得结果:
如何对每一行进行计算?例如,2007年11月第一行,总客户干预计数= 68,因此百分比计数应为57/68%
任何想法?感谢
答案 0 :(得分:0)
使用计算成员 - 您可以找到几个示例here。查询的想法如下:
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