Page 1 of 1

String Rule

Posted: Wed Oct 07, 2009 12:01 pm
by cdhodge2002
Does anybody see why this string rule will not work? TM1 say that there is a logic error before ['USP','Post Period']:

['IRA-USP','Post Period']=S:if(['USP','Post Period']@='',['IRA','Post Period'],['USP','Post Period']);

Post Period in this example is a String element. I have also created a rule where there is no if statement and IRA-USP is just equal to USP with no luck either. Is there something that I am missing in my rule.

Re: String Rule

Posted: Wed Oct 07, 2009 12:19 pm
by Mike Cowie
Hi,

You can't use internal cube references ([...])for any returned string data in a rule. You need a DB() reference instead. I don't know your cube and its dimensions, so the best example I can give you is a bit fake to illustrate:

Code: Select all

['IRA-USP', 'Post Period']=S:
if(DB('YourCube',!OtherDim1,!OtherDim2,'USP','Post Period')@='',DB('YourCube',!OtherDim1,!OtherDim2,'IRA','Post Period'),DB('YourCube',!OtherDim1!OtherDim2,'USP','Post Period') );
Putting it another way, when TM1 sees the internal cube references it always assumes a number is coming out of that and, because this rule is String-based it won't allow it to compile.

Regards,
Mike

Re: String Rule

Posted: Wed Oct 07, 2009 12:32 pm
by cdhodge2002
Awesome, thanks. If all my issues were only so easy