具有类似子句SSAS的维度值

时间:2013-04-11 12:32:41

标签: ssas mdx

我想要维度的值与like子句..我试过这个

WITH 
SET CITY
AS
FILTER(
      [CITY].[CITY].CHILDREN,
      vbamdx!INSTR([CITY].[CITY].CURRENTMEMBER.Name,'In',1 >= 1 )
)
   MEMBER [Measures].[Label] AS [CITY].[CITY].CURRENTMEMBER.MEMBER_CAPTION 
SELECT {[Measures].[Label]
      } ON COLUMNS , 
      [CITY].[CITY].ALLMEMBERS ON ROWS 
FROM [TEST_Cube]

希望名称中包含“In”的所有城市。

1 个答案:

答案 0 :(得分:3)

您没有使用自己制作的过滤集。

此外,您将您的设置命名为可能会给您带来麻烦的维度。

尝试:

WITH 

SET FilteredCities AS
FILTER
(
    [CITY].[CITY].CHILDREN,
    vbamdx!INSTR([CITY].[CITY].CURRENTMEMBER.Name,'In',1 >= 1 )
)

MEMBER [Measures].[Label] AS 
[CITY].[CITY].CURRENTMEMBER.MEMBER_CAPTION 

SELECT 
{
    [Measures].[Label]
} 
ON COLUMNS , 
      FilteredCities //Use the set
ON ROWS 
FROM [TEST_Cube]