Page 1 of 1

Advice on simple rule please...

Posted: Wed Feb 24, 2010 5:33 pm
by Christian
Hi Everyone,

I'm befuddled by an error on what I would consider a pretty simple rule. This is only part of the rule, but I've written it separately to ensure this is the problem and it appears to be.

['Service Charge % Used] = IF (['Service Charge Criteria'] @= 'Consultant'), .25, STET;

'Service Charge Criteria' is a string element.

The error I'm getting is "Syntax error on or before: ['Service Charg logical expression

??

Any help would be greatly appreciated.

Thanks,
Christian

Re: Advice on simple rule please...

Posted: Wed Feb 24, 2010 5:39 pm
by kitforshee
Could it be that you are missing an apostrophe after the word, "Used" in the element name?
---------------------------V
['Service Charge % Used] = IF (['Service Charge Criteria'] @= 'Consultant'), .25, STET;

---------------------------V
['Service Charge % Used'] = IF (['Service Charge Criteria'] @= 'Consultant'), .25, STET;

Re: Advice on simple rule please...

Posted: Wed Feb 24, 2010 5:44 pm
by kpk
1. Use ['Service Charge % Used'] instead of ['Service Charge % Used]. You missed out the ' from the end of the target area.
2. Use IF (['Service Charge Criteria'] @= 'Consultant', .25, STET); You placed the ) to wrong place.

As is: ['Service Charge % Used] = IF (['Service Charge Criteria'] @= 'Consultant'), .25, STET;
Should be: ['Service Charge % Used'] = IF (['Service Charge Criteria'] @= 'Consultant', .25, STET);

Regards,

Peter

Re: Advice on simple rule please...

Posted: Wed Feb 24, 2010 5:44 pm
by Christian
I actually have that apostrophe in my rule (it's a typo in my original post, sorry).

thanks for the quick feedback though.

Re: Advice on simple rule please...

Posted: Wed Feb 24, 2010 5:49 pm
by Mike Cowie
Christian wrote:I actually have that apostrophe in my rule (it's a typo in my original post, sorry).

thanks for the quick feedback though.
Hi Christian,

Any reference to string data in a cube cannot use the internal [] cube reference. You need to use a DB function instead for string data like Service Charge Criteria. Very confusing, I know, but to TM1 the [] references are always assumed to return a number in Rules.

Regards,
Mike

Re: Advice on simple rule please...

Posted: Wed Feb 24, 2010 5:52 pm
by Christian
kpk wrote:1. Use ['Service Charge % Used'] instead of ['Service Charge % Used]. You missed out the ' from the end of the target area.
2. Use IF (['Service Charge Criteria'] @= 'Consultant', .25, STET); You placed the ) to wrong place.

As is: ['Service Charge % Used] = IF (['Service Charge Criteria'] @= 'Consultant'), .25, STET;
Should be: ['Service Charge % Used'] = IF (['Service Charge Criteria'] @= 'Consultant', .25, STET);

Regards,

Peter

Thanks Peter. This is the actual copy and paste from the rules editor (I'm working on another PC, so that's why I didn't copy and paste initially).

['Bank Service Charge % Used' ] = IF (['Bank Service Charges Criteria' ] @= 'Consultant',.25,STET);

I'm still getting the same error. The only thing I can think of that could be the fly in the ointment is that 'Consultant' is a string field that is imported from another cube that uses a picklist for criteria selection; Consultant, Headcount, Payroll, Collections, etc. I'm having serious problems writing conditionals off of a result from a picklist. Thanks again.

Re: Advice on simple rule please...

Posted: Wed Feb 24, 2010 5:52 pm
by Christian
Mike Cowie wrote:
Christian wrote:I actually have that apostrophe in my rule (it's a typo in my original post, sorry).

thanks for the quick feedback though.
Hi Christian,

Any reference to string data in a cube cannot use the internal [] cube reference. You need to use a DB function instead for string data like Service Charge Criteria. Very confusing, I know, but to TM1 the [] references are always assumed to return a number in Rules.

Regards,
Mike
Thanks Mike...let me give that a shot.

Re: Advice on simple rule please...

Posted: Wed Feb 24, 2010 5:55 pm
by Christian
Mike...that fixed it!!!

Thanks everyone for the quick responses, you're life savers. :D