1

I am trying to use the INSTR() function with ActivePivot. I am testing by using an Instr call that should always return > 0.

Here is my initial MDX query that works fine:

 SELECT
   {
     {[CODE].[ALL].[AllMember]}
   } ON ROWS
 FROM [Cube]
 WHERE ([Measures].[contributors.COUNT])    

Here is my test InStr query:

SELECT
  NON EMPTY
    Generate
    (
      [CODE].[ALL].[AllMember]
      ,(
        Instr
        (
          "Test"
          ,"es"
        ) > 0
      )
    )ON ROWS
FROM [Cube]
WHERE ([Measures].[contributors.COUNT])

Please can you help me create a working example for the Instr MDX query in ActivePivot?

Many thanks


Edit: What I wanted to do

SELECT
NON EMPTY Hierarchize({[CODE].[CODE].Members}) ON ROWS,
NON EMPTY Hierarchize({Filter([RELEVANCE].Members,      InStr([RELEVANCE].CurrentMember.Name, "n/a") > 0)}) ON COLUMNS
FROM [Cube]
WHERE ([Measures].[contributors.COUNT])
4

1 回答 1

2

我不确定您尝试使用 MDX 实现什么,但这里有一个示例可能会有所帮助:

之前,我考虑了所有具有积极贡献者的地方。COUNT:

SELECT
NON EMPTY Hierarchize({Filter([PlaceDimension].[Continent].Members, [Measures].[contributors.COUNT] > 0)}) ON ROWS
FROM [TwitterCube]
WHERE ([Measures].[contributors.COUNT])

之后,我只保留名称中带有“a”的地方:

SELECT
NON EMPTY Hierarchize({Filter([PlaceDimension].[Continent].Members, InStr([PlaceDimension].CurrentMember.Name, "a") > 0)}) ON ROWS
FROM [TwitterCube]
WHERE ([Measures].[contributors.COUNT])
于 2012-10-08T11:07:34.383 回答