Ssas 立方体计算平均年龄(MDX)

Ssas 立方体计算平均年龄(MDX),ssas,mdx,Ssas,Mdx,我需要为HR多维数据集中的年龄中值创建多维数据集计算 措施:人数和全职员工 维度:年龄(年龄、年龄组等)、职责类型、员工(员工ID等)、日期等 我尝试使用以下MDX脚本: Median([Month Date].[Staff Profile Month Date - Hierarchy].[Month Date Calendar Year].currentmember.Children ,IIF([Age].[Age].currentmember.name ='All' ,0,StrToValu

我需要为HR多维数据集中的年龄中值创建多维数据集计算

措施:人数和全职员工

维度:年龄(年龄、年龄组等)、职责类型、员工(员工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)))
我使用了以下帮助:


如何解决这个问题?

创建名为“总和年龄”的基本度量值(使其不可见),并使用它创建中值计算度量值

Median([Staff].[Staff ID].currentmember.children,[Measures].[Sum Age])

创建名为“总和年龄”的基本度量值(使其不可见),并使用此值创建中值计算度量值

Median([Staff].[Staff ID].currentmember.children,[Measures].[Sum Age])