Click here to Skip to main content
15,868,134 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a parameter value 'SF - LYON' while trying to pass in where condition:

MEMBER [Measures].[ParameterCaption] AS [Organization].[Organization].CURRENTMEMBER.MEMBER_CAPTION
MEMBER [Measures].[Parametervalue] AS [Organization].[Organization].CurrentMember.UNIQUENAME
MEMBER [Measures].[ParameterLevel] AS [Organization].[Organization].CurrentMember.LEVEL.ORDINAL

SELECT non empty {[Measures].[ParameterCaption]
, [Measures].[ParameterValue]
, [Measures].[ParameterLevel] } ON COLUMNS
FROM [IRIS]
WHERE STRTomember('SF - LYON', CONSTRAINED) //@parameter=SF - LYON`

What I have tried:

But I am getting this error:

Query (10, 1) The restrictions imposed by the CONSTRAINED flag in the STRTOMEMBER function were violated.

When I try it like this:

WHERE STRTomember('[SF - LYON]', CONSTRAINED)   //@parameter=SF - LYON
it is working.

So my question is: How do I pass the square brackets [] through a parameter to get the desired result?
Posted
Comments
Dotnet_Dotnet 9-Jan-18 12:24pm    
sir here the square braket whether is the value or column name
BinnyVishwant 9-Jan-18 12:47pm    
its a value

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900