立方体计算中位年龄(MDX)

时间:2012-08-22 06:05:07

标签: ssas mdx

我需要在HR立方体中为中位数年龄创建立方体计算。

措施:人数和FTE

维度:年龄(年龄,年龄组,......),Duty_type,员工(Staff_ID,...),日期等

我尝试使用以下MDX脚本:

Median([Month Date].[Staff Profile Month Date - Hierarchy].[Month Date Calendar Year].currentmember.Children ,IIF([Age].[Age].currentmember.name ='All' ,0,StrToValue([Age].[Age].currentmember.name)))

我使用了以下帮助:http://msdn.microsoft.com/en-us/library/ms145570.aspx

如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

创建名为Sum Age的基本度量(使其不可见)并使用此度量来创建中值计算度量。

Median([Staff].[Staff ID].currentmember.children,[Measures].[Sum Age])
相关问题