mdx:使用mdx将行合并为单行

时间:2013-12-17 13:32:46

标签: mdx

enter image description here

从附带的屏幕截图中,我们如何将5行分组为单行,而不使用mdx查询将第2列分组?

预期的单排GD,FR,PR,NC& NT值为4

WITH
MEMBER Gd as iif([DimMetricNumeratorFrequency].[Label].currentmember is  [DimMetricNumeratorFrequency].   
[Label].&[GD],
[Measures].[Patient Key Distinct Count], null)
MEMBER fr as iif([DimMetricNumeratorFrequency].[Label].currentmember is  [DimMetricNumeratorFrequency]. 
[Label].&[FR],
[Measures].[Patient Key Distinct Count], null)
MEMBER pr as iif([DimMetricNumeratorFrequency].[Label].currentmember is  [DimMetricNumeratorFrequency].
[Label].&[PR],
[Measures].[Patient Key Distinct Count], null)
MEMBER nt as iif([DimMetricNumeratorFrequency].[Label].currentmember is  [DimMetricNumeratorFrequency].
[Label].&[NT],
[Measures].[Patient Key Distinct Count], null)
MEMBER nc as iif([DimMetricNumeratorFrequency].[Label].currentmember is  [DimMetricNumeratorFrequency].
[Label].&[NC],
[Measures].[Patient Key Distinct Count], null)


select {Gd, fr, pr, nt, nc} on 0,
([DimMetricNumeratorFrequency].[Metric Id].[Metric Id],[DimMetricNumeratorFrequency].[Label].  
[Label])      
on  1
from [StrategyCompanionDWCube]

1 个答案:

答案 0 :(得分:0)

为什么不简单地说

select [DimMetricNumeratorFrequency].[Label].[Label]
       on 0,
       { [Measures].[Patient Key Distinct Count] }    
       on  1
from [StrategyCompanionDWCube]

MDX不要求将测量值放在列上。