Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Using Multi Valued Parameter in MDX RS


Using Multi Valued Parameter in MDX RS

Author
Message
sipho.nombebe
sipho.nombebe
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 48
Hi,

I have a report where usesr can select Multi valued Parameter and I use a join in my mdx code like this:

="SELECT NON EMPTY { [Measures].[Alternate Single Manager],
[Measures].[Retail Structured]} ON COLUMNS,
NON EMPTY { ([Agent].[Agent Consultant].[Consultant Id].ALLMEMBERS ) }
DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS
FROM ( SELECT ( " & Parameters!FundFund.Value & ") ON COLUMNS FROM ( SELECT ( " & Join(Parameters!TransactionTypeTransactionTypeHierarchy.Value,",") & ") ON COLUMNS FROM [Cube]))))
WHERE ( " & Join(Parameters!TransactionTypeTransactionTypeHierarchy.Value,",") & "," & Parameters!FundFund.Value & ")
CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS"

If the user select Multi Valued Parameter, the query returns an error : The 'Transaction Type Hierarchy' hierarchy appears more than once in the tuple.

The mdx code that gets build looks like this:

SELECT NON EMPTY { [Measures].[Alternate Single Manager],
[Measures].[Retail Structured] } ON COLUMNS,
NON EMPTY { ([Agent].[Agent Consultant].[Consultant Id].ALLMEMBERS ) }
DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS
FROM ( SELECT ( [Fund].[Fund].[All]) ON COLUMNS FROM ( SELECT ( [Transaction Type].[Transaction Type Hierarchy].[Transaction Type Detail].&[1732],[Transaction Type].[Transaction Type Hierarchy].[Transaction Type Detail].&[1733]) ON COLUMNS
FROM [Cube])))
WHERE ( [Transaction Type].[Transaction Type Hierarchy].[Transaction Type Detail].&[1732],[Transaction Type].[Transaction Type Hierarchy].[Transaction Type Detail].&[1733])
CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS

Please help on this

Sipho
Nicholas Large
Nicholas Large
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 34
Hi.

You need to specify the TType as a set:

SELECT NON EMPTY { [Measures].[Alternate Single Manager],
[Measures].[Retail Structured] } ON COLUMNS,
NON EMPTY { ([Agent].[Agent Consultant].[Consultant Id].ALLMEMBERS ) }
DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS
FROM ( SELECT ( [Fund].[Fund].[All]) ON COLUMNS FROM ( SELECT ( [Transaction Type].[Transaction Type Hierarchy].[Transaction Type Detail].&[1732],[Transaction Type].[Transaction Type Hierarchy].[Transaction Type Detail].&[1733]) ON COLUMNS
FROM [Cube])))
WHERE ( [Transaction Type].[Transaction Type Hierarchy].[Transaction Type Detail].&[1732],[Transaction Type].[Transaction Type Hierarchy].[Transaction Type Detail].&[1733])
CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS

becomes

SELECT NON EMPTY { [Measures].[Alternate Single Manager],
[Measures].[Retail Structured] } ON COLUMNS,
NON EMPTY { ([Agent].[Agent Consultant].[Consultant Id].ALLMEMBERS ) }
DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS
FROM ( SELECT ( [Fund].[Fund].[All]) ON COLUMNS
FROM ( SELECT ( { [Transaction Type].[Transaction Type Hierarchy].[Transaction Type Detail].&[1732],
[Transaction Type].[Transaction Type Hierarchy].[Transaction Type Detail].&[1733] } ) ON COLUMNS
FROM [Cube])))
WHERE ( { [Transaction Type].[Transaction Type Hierarchy].[Transaction Type Detail].&[1732],
[Transaction Type].[Transaction Type Hierarchy].[Transaction Type Detail].&[1733] })
CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS

You also do not need the where clause, you already have the data in the subselect.

Hope this helps,
Nick.
ashish sinha-404083
ashish sinha-404083
Valued Member
Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)

Group: General Forum Members
Points: 64 Visits: 275
Hi,

How did you get the first part of the parameter, that is - "[Transaction Type].[Transaction Type Hierarchy].[Transaction Type Detail].&[".

I am struggling with that.

Please help.

Regards,
Ashish Sinha
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search