7

Parser: The query contains the XXXXXName parameter, which is not declared. (msmgdsrv)

I have no idea why I keep getting this error. It occurs when I change the MDX in the query designer and trying OKing out of the query designer.

The strange thing is that the parameter DOES exist, I can see it in the parameters section of the dataset dialog. I am creating it before I do anything else with the query.

adolf garlic
  • 3,034
  • 7
  • 39
  • 54

2 Answers2

8

Although the seemingly intuitive thing to do is add the Parameter in the Dataset Properties window, this actually does not declare the parameter for the query for some odd reason.

To add the parameter, click the Parameters toolbar button in the Query Designer window. From there you can add your parameter names and default values.

enter image description here

Once you've done this, the global parameter list will contain that parameter and allow you to use expressions etc..

Manoj Attal
  • 2,806
  • 3
  • 28
  • 31
Christopher Scott
  • 2,676
  • 2
  • 26
  • 26
  • I've declared the parameter in the Dataset Properties window, but I still having the same issue. – Lucas Feb 01 '17 at 09:11
  • This fixed it for me and not only that, after I managed to refresh the fields I noted a field name was changed which solved _another_ issue I was having. This should be the answer. – Nick.Mc Apr 07 '17 at 01:46
  • 1
    But BEWARE: when you open the Query Designer, the MDX code inside is yet another version of code that may not match your original code, and it _overwrite_ your existing code. So before you press OK on the Query Designer, double check the code inside it – Nick.Mc Apr 07 '17 at 04:27
  • Query Designer is literally a bug. Do not use. – Gary Thomann May 31 '22 at 05:00
0

Is the parameter defined at the report level? That might be what's missing.

jvilalta
  • 6,679
  • 1
  • 28
  • 36