locked
Trying to User UserID!User as parameter causing an invalid token error RRS feed

  • Question

  • I'm trying to do something simple -- pass in the built-in UserID field as a parameter to my mdx query.  I'm getting a message saying it has an invalid token and is referencing the backslash between the domain name and user id.  Am I missing something obvious?

    Friday, September 13, 2013 8:25 PM

Answers

  • Thank you so much for the response and the suggestion!!  However, that hasn't worked for me :(.  I've tried every variation I can think of -- from hard coding a specific user ID just to see if that would work (it didn't), to doing something similar to what you have -- making my parameter look like this:

    ="Jefferson\" & CSTR(Mid(User!UserID, InStr(User!UserID, "\") + 1, len(User!UserID) - InStr(User!UserID, "/")))

    No matter how I try to pass it in, it fusses when it gets to the slash.

    As a workaround, I've created a stored procedure and am passing the User!UserID into it to retrieve what I need.  This works, although it is a tad bit slower.

    • Marked as answer by Fanny Liu Friday, September 20, 2013 10:13 AM
    Monday, September 16, 2013 1:22 PM

All replies

  • Hi puffster,

    Define parameter in the MDX query designer is different with typical report parameter.

    In Microsoft SQL Server Analysis Services, dimensions are a fundamental component of cubes. Dimensions in Analysis Services contain attributes that correspond to columns in dimension tables. In SSRS Report the members should be ordered in descending order.

    In SSRS we defined cube parameter with the format like below example. The issue may be caused by it.
    =”[Year].[Year].&[”+CSTR(Year(Today))+”]”

    You can refer to the articlebelow:
    http://www.bidn.com/blogs/DevinKnight/ssis/144/ssrs-setting-default-parameter-values-for-analysis-services-datasets

    hope this helps.

    Regards,
    Alisa Tang

    Monday, September 16, 2013 1:01 PM
  • Thank you so much for the response and the suggestion!!  However, that hasn't worked for me :(.  I've tried every variation I can think of -- from hard coding a specific user ID just to see if that would work (it didn't), to doing something similar to what you have -- making my parameter look like this:

    ="Jefferson\" & CSTR(Mid(User!UserID, InStr(User!UserID, "\") + 1, len(User!UserID) - InStr(User!UserID, "/")))

    No matter how I try to pass it in, it fusses when it gets to the slash.

    As a workaround, I've created a stored procedure and am passing the User!UserID into it to retrieve what I need.  This works, although it is a tad bit slower.

    • Marked as answer by Fanny Liu Friday, September 20, 2013 10:13 AM
    Monday, September 16, 2013 1:22 PM