Replacing a variable inside a query text - The parameter could not be resolved because it was referenced in an inner subexpression

  • Inside a report dataset, I'm having an MDX query which has the following line in it:

    SELECT STRTOSET ( ' { @LocationParam } ' ) ON COLUMNS

    with a parameter named @LocationParam which expression is ="[Location].[Name].&[Location1]"

    When replacing the @LocationParam inside the MDX by pasting [Location].[Name].&[Location1] (SELECT STRTOSET ( ' { [Location].[Name].&[Location1] } ' ) ON COLUMNS) and running the whole MDX (unchanged for the remaining) inside SSAS or inside SSRS, it runs without issue.

    But inside SSRS, using the parameter @LocationParam, once run, I get the following error and I don't know why:

    "The @LocationParam parameter could not be resolved because it was referenced in an inner subexpression"

    Using the profiler with the event "Query Begin", I can notice the parameter "@LocationParam" is correct

    <Parameter>

    <Name>LocationParam</Name>

    <Value xsi:type="xsd:string">[Location].[Name].&[Location1]</Value>

    </Parameter>

    Thank you

  • I've got my own answer.

    Double quotation marks "" are implicitly added around the parameter which provoke the parsing error once the query is fully assemble.

Viewing 2 posts - 1 through 1 (of 1 total)

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