Page 1 of 1

"invalid string error"- tm1 9.5.2- server explorer

Posted: Wed Sep 27, 2017 6:30 pm
by duadis7
i am having an issue with the rules on a specific cube called "manufacturing".

this is the original syntax:

['Number_Of_Appearance_Temp2_Manual' , 'C05P201'] = N:
IF ((ATTRS('D_Product' , !D_Product , 'Mapping_To_PC') @<>'' ) &
(ELISANC('D_Paper_Type','CS_ALL',DB('Manufacturing',ATTRS('D_Product' , !D_Product , 'Mapping_To_PC'),!D_Product,!D_Project,!D_Year,!D_Month,!D_Version,'Paper_Type'))=1),
DB('Manufacturing',ATTRS('D_Product' , !D_Product , 'Mapping_To_PC') ,!D_Product,!D_Project,!D_Year,!D_Month,!D_Version,'Number_Of_Appearance_Temp2_Manual')

this is the changed syntax:

['Number_Of_Appearance_Temp2_Manual' , 'C05P201'] = N:
IF ((DB('ben_test_product_attributes',!D_Year,!D_Product_Copy,'Mapping_To_PC') @<>'' ) &
(ELISANC('D_Paper_Type','CS_ALL',DB('Manufacturing',DB('ben_test_product_attributes',!D_Year,!D_Product_Copy,'Mapping_To_PC'),!D_Product,!D_Project,!D_Year,!D_Month,!D_Version,'Paper_Type'))=1),
DB('Manufacturing',DB('ben_test_product_attributes',!D_Year,!D_Product_Copy,'Mapping_To_PC') ,!D_Product,!D_Project,!D_Year,!D_Month,!D_Version,'Number_Of_Appearance_Temp2_Manual')

Basically, I changed the reference from ATTRS(....) to DB(.....).
it should return the same value, because the cube in 'ben_test_product_attributes' in the DB(...) works fine.

THE Error i'm getting is:
Syntax Error on or before;
!D_Product_Copy,'Map
invalid string expression
Rule could not be attached to the cube ,but changes are saved.

i was hoping someone can help me.
i've looked this error up in the internet and it has a few suggestions:
1. change the name of the dimension D_Product_Copy
2. use in the first line: = S: INSTEAD OF N:

NOTE: D_Product_Copy is a copied dimension of D_product through copy/paste in the tm1 folder. maybe it is related.

I'm open to suggestions.
thank you

Re: "invalid string error"- tm1 9.5.2- server explorer

Posted: Wed Sep 27, 2017 6:47 pm
by Wim Gielis
Hi,

I guess this error pops up because you use a wrong element reference.
You can only use the notation !dimension for dimensions that are part of the cube to which the rules are attached.
Can you first verify this ?

Re: "invalid string error"- tm1 9.5.2- server explorer

Posted: Wed Sep 27, 2017 7:37 pm
by tomok
In your first rule you are referencing an attribute from the D_Product dimension and then in your second rule you are pulling a value from a cube called bem_test_product_attributes. However, it looks like that cube does not use the D_Product dimension but a copy of it called D_Product_Copy. Which of these product dimensions is in the Manufacturing cube? If it is D_Product then your revised rule should be:

Code: Select all

['Number_Of_Appearance_Temp2_Manual' , 'C05P201'] = N:
IF ((DB('ben_test_product_attributes',!D_Year,!D_Product,'Mapping_To_PC') @<>'' ) &
(ELISANC('D_Paper_Type','CS_ALL',DB('Manufacturing',DB('ben_test_product_attributes',!D_Year,!D_Product,'Mapping_To_PC'),!D_Product,!D_Project,!D_Year,!D_Month,!D_Version,'Paper_Type'))=1),
DB('Manufacturing',DB('ben_test_product_attributes',!D_Year,!D_Product,'Mapping_To_PC') ,!D_Product,!D_Project,!D_Year,!D_Month,!D_Version,'Number_Of_Appearance_Temp2_Manual') 
You can't reference the D_Product_Copy dimension in a rule unless that dimension exists in the cube the rule is being written for.

Re: "invalid string error"- tm1 9.5.2- server explorer

Posted: Wed Sep 27, 2017 7:52 pm
by duadis7
hi Wim and Tom,
the Cube that is refernced in the DB FUNCTION certainly conatins the specified dimensions and elements.
that db function was in fact written through the rule editor wizard(the bottom pane) so there couldn't be a mistake in that case.

maybe, it is related to what i wrote in the NOTE- that i copied the dimension from the tm1 folder ( and renamed it to D_Product_Copy).
or it is something else that indeed relates to a SYNTAX ERROR

Re: "invalid string error"- tm1 9.5.2- server explorer

Posted: Wed Sep 27, 2017 8:09 pm
by tomok
duadis7 wrote: Wed Sep 27, 2017 7:52 pm the Cube that is refernced in the DB FUNCTION certainly contains the specified dimensions and elements.
That's not what I said. Is the D_Product_Copy in the Manufacturing cube?????? If it isn't then you cannot reference it in a rule. That's because the rule syntax checker can only validate dimensions that are in the cube you are writing the rule for. It doesn't matter one spit that the D_Product_Copy dimension is in the ben_test_product_attributes cube. Your error is because D_Product_Copy IS NOT IN THE MANUFACTUrING CUBE.

Re: "invalid string error"- tm1 9.5.2- server explorer

Posted: Thu Sep 28, 2017 6:56 am
by duadis7
THANK YOU SO MUCH TOM!
you are absolutely right

have a great day!