Wednesday, March 7, 2012

MDx Query Parameters

Hi,
I'm trying to use mdx query in reporting services with a parameters.
But I am getting an error telling me my token is invalid my query
string is this:
SELECT NON EMPTY { [Measures].[Executions] } ON COLUMNS, NON EMPTY
{ Members("[Dates].[All Dates].[" + @.Year + "]." + "[June]") }
DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM
[Procedure Completions] CELL PROPERTIES VALUE
I've declared Year right now I am just using the default value of 2007
but I keep on getting this error:
Formula error - syntax error - token is not valid: "{ Members("[Dates].
[All Dates].[" + ^@.^Year+"]." + "[June]") }" (urn:schemas-microsoft-
com:xml-analysis)
Any ideas of what I could be doing wrong?Try using the following:
{ Members(STRTOSET("[Dates].[All Dates].[" + @.Year + "]." + "[June]"),
CONSTRAINED) }
Although if I were doing it I would do it like this.
{Members(STRTOSET(@.Dateparameter,CONSTRAINED))} and then do the string
manipulation in the parameters section of the data set properties. The DS
properties are the "..." next to the name of the DS. You can use VB to
create an expression in there. This way you can use the query builder to
create your MDX for you.
Hope this helps,
Al
<RMurjani85@.gmail.com> wrote in message
news:1185475682.673977.86900@.g4g2000hsf.googlegroups.com...
> Hi,
> I'm trying to use mdx query in reporting services with a parameters.
> But I am getting an error telling me my token is invalid my query
> string is this:
> SELECT NON EMPTY { [Measures].[Executions] } ON COLUMNS, NON EMPTY
> { Members("[Dates].[All Dates].[" + @.Year + "]." + "[June]") }
> DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM
> [Procedure Completions] CELL PROPERTIES VALUE
> I've declared Year right now I am just using the default value of 2007
> but I keep on getting this error:
> Formula error - syntax error - token is not valid: "{ Members("[Dates].
> [All Dates].[" + ^@.^Year+"]." + "[June]") }" (urn:schemas-microsoft-
> com:xml-analysis)
> Any ideas of what I could be doing wrong?
>

No comments:

Post a Comment