过滤参数MDX错误

时间:2015-05-27 21:33:31

标签: mdx ssrs-2012

mdx新手并尝试过滤一个参数。我有以下内容,

WITH MEMBER [Measures].[ParameterCaption] AS  IIF(IsEmpty([Measures].[Charge Count]),null, [Payment].[Description].CurrentMember .MEMBER_CAPTION)
MEMBER [Measures].[ParameterValue] AS  IIF(IsEmpty([Measures].[Charge Count]), null, [Payment].[Description].CurrentMember.UniqueName)
MEMBER [Measures].[ParameterLevel]  AS  IIF(IsEmpty([Measures].[Charge Count]), null, [Payment].[Description].CurrentMember .Level .Ordinal)
SELECT
{ [Measures].[ParameterCaption],
  [Measures].[ParameterValue], 
  [Measures].[ParameterLevel] } ON COLUMNS
, NONEMPTY ([Primary].[Description].ALLMEMBERS, [Measures].[Charge Count]) ON ROWS
FROM (SELECT (STRTOSET(@Client, CONSTRAINED) ON COLUMNS
              FROM [DACUBE]))

带有'ON'的倒数第二行的错误。这个似乎都是正确的,除了这个错误有人能告诉我哪里出错了吗?

1 个答案:

答案 0 :(得分:0)

我认为您的大括号不太正确 - 请尝试以下方法:

WITH 
  MEMBER [Measures].[ParameterCaption] AS 
    IIF
    (
      IsEmpty([Measures].[Charge Count])
     ,null
     ,[Payment].[Description].CurrentMember.Member_Caption
    ) 
  MEMBER [Measures].[ParameterValue] AS 
    IIF
    (
      IsEmpty([Measures].[Charge Count])
     ,null
     ,[Payment].[Description].CurrentMember.UniqueName
    ) 
  MEMBER [Measures].[ParameterLevel] AS 
    IIF
    (
      IsEmpty([Measures].[Charge Count])
     ,null
     ,[Payment].[Description].CurrentMember.Level.Ordinal
    ) 
SELECT 
  {
    [Measures].[ParameterCaption]
   ,[Measures].[ParameterValue]
   ,[Measures].[ParameterLevel]
  } ON COLUMNS
 ,NonEmpty
  (
    [Primary].[Description].ALLMEMBERS
   ,[Measures].[Charge Count]
  ) ON ROWS
FROM 
(
  SELECT 
    StrToSet
    (@Client
     ,CONSTRAINED
    ) ON COLUMNS
  FROM [DACUBE]
);