TM1 Rule - Mixing And Or in a If Statement

Post Reply
kenship
Regular Participant
Posts: 194
Joined: Thu May 30, 2013 1:41 pm
OLAP Product: Cognos
Version: Planning Analytics 2.0.7
Excel Version: 2010

TM1 Rule - Mixing And Or in a If Statement

Post by kenship »

Hi,

I made myself into some trouble when using and mixing multiple & (AND) and % (OR) in a If condition.

Let me explain:
Condition A: Change Type
Condition B: Year

If (
A = Inflation
&
B = 2018
%
B = 2019
,1%
,STET)

I meant to put 1% in 2018+Inflation and 2019+Inflation then nothing for the rest.

I realize that the way I put the rule is confusing the years. And I have to split it into 2 rules.

I wonder whether there's a way to tie it in one rule without using multiple If.

Kenneth
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: TM1 Rule - Mixing And Or in a If Statement

Post by tomok »

You should never hard code rates into a rule like this. I know it is really easy but once you get a rule file full of this crap it's almost impossible to maintain or add onto. Make you inflation rate an attribute of the time dimension then no IFs ANDs or BUTs are needed.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
kenship
Regular Participant
Posts: 194
Joined: Thu May 30, 2013 1:41 pm
OLAP Product: Cognos
Version: Planning Analytics 2.0.7
Excel Version: 2010

Re: TM1 Rule - Mixing And Or in a If Statement

Post by kenship »

It's just an example. It's not even about inflation at all.

The original rule is much much longer and I believe it's not helping to provide them.

My struggle is whether I can do a Inflation & 2018 AND Inflation & 2019 without using multiple Ifs or 2 rules.

Kenneth
declanr
MVP
Posts: 1815
Joined: Mon Dec 05, 2011 11:51 am
OLAP Product: Cognos TM1
Version: PA2.0 and most of the old ones
Excel Version: All of em
Location: Manchester, United Kingdom
Contact:

Re: TM1 Rule - Mixing And Or in a If Statement

Post by declanr »

I think the high level concept you are trying to get to is just fixed by using brackets but I may not understand your question fully.

Code: Select all

['Measure']=N: If ( ( ['Thing'] = 1 % ['Thing'] = 2 ) & ( ['ymabob'] = x ), do stuff, do other stuff );
Declan Rodger
kenship
Regular Participant
Posts: 194
Joined: Thu May 30, 2013 1:41 pm
OLAP Product: Cognos
Version: Planning Analytics 2.0.7
Excel Version: 2010

Re: TM1 Rule - Mixing And Or in a If Statement

Post by kenship »

I'll try that, thanks a lot!
Post Reply