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
TM1 Rule - Mixing And Or in a If Statement
-
- MVP
- Posts: 2832
- 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
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.
-
- 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
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
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
-
- 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
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
-
- 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
I'll try that, thanks a lot!