SSRS MDX查询不适用于多值参数

时间:2013-03-03 08:53:59

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

我需要你的帮助!!

我想使用SSRS创建一个包含多值参数的报告。

所以,我写了这个mdx脚本:

WITH 
-- Geography metadata

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

-- Activity metadata

MEMBER [Measures].[Activite]
   AS StrToValue( @SelectionActivite + ".Hierarchy.Currentmember.Uniquename" )
MEMBER [Measures].[Activite_Label]
   AS StrToValue( @SelectionActivite + ".Hierarchy.CurrentMember.Member_Caption" )

-- Date metadata

MEMBER [Measures].[Temps]
   AS StrToValue( @Annee + ".Hierarchy.Currentmember.Uniquename" )
MEMBER [Measures].[Temps_Label]
   AS StrToValue( @Annee + ".Hierarchy.CurrentMember.Member_Caption" )

-- Perimetre metadata
MEMBER [Measures].[Perimetre]
   AS StrToValue( @Perimetre + ".Hierarchy.Currentmember.Uniquename" )
MEMBER [Measures].[Perimetre_Label]
   AS StrToValue( @Perimetre + ".Hierarchy.CurrentMember.Member_Caption" )


SELECT NON EMPTY {
 -- display the parameters  attributes on columns

 [Measures].[Geographie],
 [Measures].[Geographie_Label],


 [Measures].[Activite],
 [Measures].[Activite_Label],

 [Measures].[Temps],
 [Measures].[Temps_Label],

 [Measures].[Perimetre],
 [Measures].[Perimetre_Label],


 [Measures].[11 VA]


} ON COLUMNS, 

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


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


ON ROWS

FROM [MyCube]

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

但它适用于参数中的一个值而不是多值参数。  当我有多个值时,我的元数据成员中的结果为null。

有什么想法吗?

谢谢你

1 个答案:

答案 0 :(得分:1)

  

使用    - 地理元数据     会员[措施]。[地理] AS“[地理]。”+ @NiveauGeographie +“。Currentmember.Uniquename”

     

会员[措施]。[Geographie_Label] AS“[Geographie]。”+ @NiveauGeographie   + “CurrentMember.Member_Caption”

     

SELECT NON EMPTY {[Measures]。[Geographie],   [措施]。[Geographie_Label],[措施]。[11 VA]

     

}在COLUMNS上,

     

(STRTOSET(“{”+ @SelectionGeographie +“}”),

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

ON ROWS

     

FROM [MyCube]

     

在哪里STRTOTUPLE(“(”+ @ Annee +“,”+ @Perimetre +“)”