Quotes issue in MDX

  • Can some one help me fixing the quote issue in this "SET", I am not sure what I am missing, It fails saying Type mismatch at '+' operator.

    SET [FISCAL WK NBR] AS

    {

    StrToMember('[DIM TIME].[FISC YR WK NBR].[FISC YR WK NBR].['+ " & Parameters!prmStartWeek_INT.Value &" + ']' ):

    StrToMember('[DIM TIME].[FISC YR WK NBR].[FISC YR WK NBR].['+" & Parameters!prmEndWeek_INT.Value &" + ']' )

    }

  • Looks like you're stringing together a dynamic mdx statement in RS (hence the additional quotes). The real issue (the one causing your error) looks to be that you have an integer parm value that you're trying to string together with strings. Do an explicit conversion and you should be ok. I can't remember whether it's supported but I'd try either CStr() (cast to string) or possibly Parameters!prmStartWeek_INT.Value.ToString() , assuming the standard .net string functions are available in the RS environment.

    SET [FISCAL WK NBR] AS

    {

    StrToMember('[DIM TIME].[FISC YR WK NBR].[FISC YR WK NBR].['+ " & CStr(Parameters!prmStartWeek_INT.Value) &" + ']' ):

    StrToMember('[DIM TIME].[FISC YR WK NBR].[FISC YR WK NBR].['+" & CStr(Parameters!prmEndWeek_INT.Value) &" + ']' )

    }

    Cheers,

    Steve.

    Steve.

  • Thanks for your reply Steve, I tried your change but still no luck, Getting the same error, I also changed the parameter type to String (from integer) and just have the parameter part...same error,:unsure:

  • Have you tried replacing the pluses with ampersands? so ...WK NBR].[' & " & CStr(Parameters!prmStartWeek_INT.Value) &" & ']

    Steve.

  • Yes i did but it does not seem to work....

  • I just made it simple by removing extra Str converstions and made the report parameter as string and it worked

    SET [FISCAL WK NBR] AS

    {

    [DIM TIME].[FISC YR WK NBR].[FISC YR WK NBR].[" & Parameters!prmStartWeek_INT.Value & "]:

    [DIM TIME].[FISC YR WK NBR].[FISC YR WK NBR].[" & Parameters!prmEndWeek_INT.Value & "]

    }

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply