Invalid string

Post Reply
aryan
Posts: 7
Joined: Fri May 04, 2018 3:39 pm
OLAP Product: oracle
Version: 10.2.2
Excel Version: 2013

Invalid string

Post 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
Wim Gielis
MVP
Posts: 3105
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Invalid string

Post 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.
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
aryan
Posts: 7
Joined: Fri May 04, 2018 3:39 pm
OLAP Product: oracle
Version: 10.2.2
Excel Version: 2013

Re: Invalid string

Post 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.
Wim Gielis
MVP
Posts: 3105
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Invalid string

Post 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.
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
User avatar
Steve Rowe
Site Admin
Posts: 2410
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: TM1 v6,v7,v8,v9,v10,v11+PAW
Excel Version: Nearly all of them

Re: Invalid string

Post 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.
Technical Director
www.infocat.co.uk
Post Reply