I have a crossjoin that looks like this
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]
I want to be able to dynamically remove the crossjoin on Groups In Rows according to a parameter so that in pseudo mdx we would have
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]
Is anything like this possible?
Since you use the
@UseGroupsnotation, I’m assuming you’re refering to a Reporting Services parameter.You can use an expression for the query, and construct the query in regards to the parameter:
You have to include the All member for the false branch of the
Iiffunction, because of metadata problems.