1

私はこのようなクロス結合を持っています

SELECT  
  {[Measures].[Respondent Count]} ON COLUMNS
 ,{
      [Groups In Rows].[Group].ALLMEMBERS*
      [Questions In Rows].[By ShortCode].[Option].ALLMEMBERS*
      [Questions In Columns].[By ShortCode].[Option].ALLMEMBERS
  } ON ROWS
FROM [cube]

疑似mdxで持つように、パラメーターに従ってGroups In Rowsのクロス結合を動的に削除できるようにしたい

SELECT  
  {[Measures].[Respondent Count]} ON COLUMNS
 ,
IIF(@UseGroups = "yes",
{     [Groups In Rows].[Group].ALLMEMBERS*
      [Questions In Rows].[By ShortCode].[Option].ALLMEMBERS*
      [Questions In Columns].[By ShortCode].[Option].ALLMEMBERS
  },
{
      [Questions In Rows].[By ShortCode].[Option].ALLMEMBERS*
      [Questions In Columns].[By ShortCode].[Option].ALLMEMBERS
} ON ROWS
FROM [Cube]

このようなことは可能ですか?

4

1 に答える 1

0

表記法を使用@UseGroupsしているため、Reporting Services パラメーターを参照していると思います。

クエリに式を使用し、パラメータに関してクエリを作成できます。

="SELECT { [Measures].[Respondent Count] } ON COLUMNS, "
&"       { "
& Iif(@UseGroups = "yes",
      "[Groups In Rows].[Group].ALLMEMBERS*",
      "[Groups In Rows].[Group].All")
&"         [Questions In Rows].[By ShortCode].[Option].ALLMEMBERS* "
&"         [Questions In Columns].[By ShortCode].[Option].ALLMEMBERS "
&"       } ON ROWS "
&"  FROM [Cube]"

Iifメタデータの問題のため、関数の false ブランチに All メンバーを含める必要があります。

于 2011-12-16T17:06:42.853 に答える