如何在MDX中获取维度度量计数的所有组合。在下图中,我获取了单个值度量计数,但如何获取值组合度量count.Say例如,我获取了262,210和198 DrKey维度的单个值计数。我需要像1) 262和210这样的值计数组合以及度量计数2) 262和198以及度量计数3) 198和210以及度量计数4) 262,210和198以及度量计数
下面是我的问题:
WITH
MEMBER DrKey AS
[DimPopulation].[Population Key].CurrentMember.Member_Key
MEMBER [Measures].[DrList] AS
NonEmpty
(
{[DimPopulation].[Population Key].&[262], [DimPopulation].[Population Key].&[210]}
,[Measures].[DrPatientKeyCnt]
)
SELECT
{
DrKey
,[Measures].[DrPatientKeyCnt]
,DrList
} ON COLUMNS
,NonEmpty
(
{
[DimPopulation].[Population Key].&[262]
,[DimPopulation].[Population Key].&[210]
,[DimPopulation].[Population Key].&[198]
}
,[Measures].[DrPatientKeyCnt]
) ON ROWS
FROM [abc]
WHERE
(
[DimAnchorDate].[Date Key].&[20141031]
,[DimReport].[Report Key].&[1]
);
发布于 2014-12-08 16:10:42
它是否仍然显示错误?
//WITH
//MEMBER DrKey AS
//[DimPopulation].[Population Key].CurrentMember.Member_Key
WITH
MEMBER [Measures].[DrList] AS
NonEmpty
(
{[DimPopulation].[Population Key].&[262], [DimPopulation].[Population Key].&[210]}
,[Measures].[DrPatientKeyCnt]
)
SELECT
{
//DrKey,
[Measures].[DrPatientKeyCnt]
,DrList
} ON COLUMNS
,NonEmpty
(
{
[DimPopulation].[Population Key].&[262]
,[DimPopulation].[Population Key].&[210]
,[DimPopulation].[Population Key].&[198]
}
,[Measures].[DrPatientKeyCnt]
) ON ROWS
FROM [abc]
WHERE
(
[DimAnchorDate].[Date Key].&[20141031]
,[DimReport].[Report Key].&[1]
);
发布于 2014-12-08 15:55:25
尝试在元组周围使用aggregate
函数:
WITH
MEMBER DrKey AS
[DimPopulation].[Population Key].CurrentMember.Member_Key
MEMBER [Measures].[DrList] AS
AGGREGATE(
NonEmpty
(
{[DimPopulation].[Population Key].&[262], [DimPopulation].[Population Key].&[210]}
,[Measures].[DrPatientKeyCnt]
)
)
SELECT
{
DrKey
,[Measures].[DrPatientKeyCnt]
,DrList
} ON COLUMNS
,NonEmpty
(
{
[DimPopulation].[Population Key].&[262]
,[DimPopulation].[Population Key].&[210]
,[DimPopulation].[Population Key].&[198]
}
,[Measures].[DrPatientKeyCnt]
) ON ROWS
FROM [abc]
WHERE
(
[DimAnchorDate].[Date Key].&[20141031]
,[DimReport].[Report Key].&[1]
);
https://stackoverflow.com/questions/27358565
复制