Page 1 of 1

Invalid string

Posted: Sat Jun 02, 2018 7:07 am
by aryan
DIMENSIONELEMENTINSERT('P','',vPeriod,'s');
DIMENSIONELEMENTINSERT('E','',vEntity,'s');
DIMENSIONELEMENTINSERT('CP','',vCP,'s');
DIMENSIONELEMENTINSERT('MT','',vMT,'s');
DIMENSIONELEMENTINSERT('AT','',vAT,'n');
DIMENSIONELEMENTINSERT('CT','',vCT,'n');
DIMENSIONELEMENTINSERT('BVI','',vBVI,'n');
DIMENSIONELEMENTINSERT('BVR','',vBVR,'n');
DIMENSIONELEMENTINSERT('TC','',vTC,'n');
DIMENSIONELEMENTINSERT('AC','',vAC,'n');
DIMENSIONELEMENTINSERT('EUR','',vEUR,'n');
Dis is my code when i try to save the code i am getting an error as
Procedure: Metadata
line number: 10
Error: syntax error on or before: vAT,'n');
invalid string expression
can u plz help me i finding dis i didn't get where i am getting the error

Re: Invalid string

Posted: Sat Jun 02, 2018 8:40 am
by Wim Gielis
Most probably your variable vAT is of type Numeric. It should be String (textual)

By the way do you use these kind of short dimension names ? While you can, the names are far from clear and I would vote against it.

Re: Invalid string

Posted: Sat Jun 02, 2018 8:53 am
by aryan
Wim Gielis wrote: Sat Jun 02, 2018 8:40 am Most probably your variable vAT is of type Numeric. It should be String (textual)

By the way do you use these kind of short dimension names ? While you can, the names are far from clear and I would vote against it.
Thanku Wim Gielis
But where i have to use the string its a numeric variable.
i named the dimensions in that way just for practice.

Re: Invalid string

Posted: Sat Jun 02, 2018 9:09 am
by Wim Gielis
Every element in a dimension must be of type String.
I repeat, every element in a dimension must be of type String.
Also the year 2018 in a dimension of years is a string, not the number 2018.
Therefore, it might be that you need to convert a number to a string.
What function could you use? ........ NumberToString.

Re: Invalid string

Posted: Sat Jun 02, 2018 10:14 am
by Steve Rowe
This issue often happens because the wizard in the data tab assumes that every field that contains a number is a numeric variable type. So your year field will often end up as a numeric variable. This then causes syntax errors at a later stage.
So check the data tab basically.