"invalid string error"- tm1 9.5.2- server explorer

Post Reply
duadis7
Posts: 3
Joined: Mon Sep 25, 2017 6:46 am
OLAP Product: tm1
Version: 9.5.2
Excel Version: 2007

"invalid string error"- tm1 9.5.2- server explorer

Post 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
Wim Gielis
MVP
Posts: 3113
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 error"- tm1 9.5.2- server explorer

Post 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 ?
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
tomok
MVP
Posts: 2831
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

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

Post 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.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
duadis7
Posts: 3
Joined: Mon Sep 25, 2017 6:46 am
OLAP Product: tm1
Version: 9.5.2
Excel Version: 2007

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

Post 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
tomok
MVP
Posts: 2831
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

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

Post 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.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
duadis7
Posts: 3
Joined: Mon Sep 25, 2017 6:46 am
OLAP Product: tm1
Version: 9.5.2
Excel Version: 2007

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

Post by duadis7 »

THANK YOU SO MUCH TOM!
you are absolutely right

have a great day!
Post Reply