mdx脚本中的Uniquename函数

时间:2013-02-28 06:35:35

标签: sql-server-2008-r2 reporting-services mdx

我真的需要你的帮助。

对于SSRS报告,我有这个mdx脚本:

select 
 {[Geographie].[Commune].[AHUY], [Geographie].[Commune].[BRETENIERE]} on columns
,{[Activite].[Branche].&[B], [Activite].[Branche].&[C]} on rows
from [ACSEL2]
where ([Measures].[CATTC], [Perimetre].[Perimetre].&[2], [Temps].[Annee].&[2006])

请,我需要为列表

中的成员提供单一序列
({[Geographie].[Commune].[AHUY], [Geographie].[Commune].[BRETENIERE]})

请你帮我写这个mdx脚本吗?

粒豆

2 个答案:

答案 0 :(得分:2)

使用With语句声明成员,如下所示:

WITH MEMBER [Measures].[UniqueName] as [Geographie].[Commune].CurrentMember.UniqueName
Select
--Your select here

有关CurrentMember

的更多详情

答案 1 :(得分:0)

    WITH 
-- Geography metadata
MEMBER [Measures].[Geographie]
AS StrToValue ( @SelectionGeographie + ".Hierarchy.Currentmember.Uniquename" )
MEMBER [Measures].[Geographie_Label]
AS StrToValue( @SelectionGeographie + ".Hierarchy.CurrentMember.Member_Caption" )

SELECT NON EMPTY {
[Measures].[Geographie],
[Measures].[Geographie_Label],
[Measures].[11 VA]


} ON COLUMNS, 

( STRTOSET ( "{" + @SelectionGeographie + "}") ,


    STRTOSET   ("{" + @SelectionActivite + "}" ))


ON ROWS

 FROM [MyCube]

WHERE STRTOTUPLE ( "(" +@Annee + "," + @Perimetre + ")" )