What you are asking for is exactly how rules work in TM1. TM1 rules does not use the ELSE function because if a rule resolves to a CONTINUE then the next applicable rule will be evaluated (Read as the ELSE clause)
[Apply The Following Rules to These Cells] = CellTypeQualifier:
IF(Element, Value, or Something Else meets X condition
, Apply this logic (can be another logical test) if True
, Apply this logic (can be another logical test) if False
);
The key is to remember that the rules are evaluated from top to bottom and a cell can only have 1 calculation attached to it, but it can go through many logical tests to get to the calculation. So for example if you wanted to find something like an effective rate by traversing a location hierarchy it may look like this.
['Effective rate'] =N:
IF(['rate'] <> 0
,['Rate']
,IF(DB('Rates by Location', !Version, !Time, ATTRS('location', !Location', 'Region') <> 0
,DB('Rates by Location', !Version, !Time, ATTRS('location', !Location', 'Region')
,IF(DB('Rates by Location', !Version, !Time, ATTRS('location', !Location', 'Country') <> 0
,DB('Rates by Location', !Version, !Time, ATTRS('location', !Location', 'Country')
,DB('Rates by Location', !Version, !Time, 'All Locations')
)
)
);
This rule looks up the tree using attributes to see is there a local rate then we should use it, if not check for the regional rate, then check for the country rate, if all else fails then use the all locations rate.
You could easily write this as individual statements using CONTINUE as well.
IF(['rate'] <> 0
,['Rate']
,CONTINUE
);
['Rate'] =N: F(DB('Rates by Region', !Version, !Time, ATTRS('location', !Location', 'Region') <> 0
,DB('Rates by Region', !Version, !Time, ATTRS('location', !Location', 'Region')
,CONTINUE
);
..... ETC
------------------------------
Ryan Clapp
------------------------------
Original Message:
Sent: 12-06-2018 05:48 PM
From: Shubho Ghosal
Subject: Getting out of the range defined for STET on whole cube
Hi George,
You are absolutely right in stating that the second STET would not apply.
I did use the other suggestion of yours, which is to use a specific Iteration Number in each rule, but it was a little more cumbersome.
It would have been great to have the following type of way to apply business rules -
If (Condition) Then (Rule Set Below) Else (Move on to next If)
Rule 1
Rule 2
etc.
Looks like that is not possible in TM1 at this point, which is unfortunate.
------------------------------
Shubho Ghosal
Original Message:
Sent: 11-29-2018 02:14 AM
From: George Tonkin
Subject: Getting out of the range defined for STET on whole cube
Have you tried:
['IRR Iterations':'1']=<rule>;
To apply rules to iteration 1 only?
The problem I see with your:
[]=IF(!IRR Iterations @= '1', CONTINUE, STET);
and
[]=IF(!IRR Iterations @= '2', CONTINUE, STET);
Is that where IRR Iterations@='2' in the first statement, it will be STET'ed and not run in the second.
Difficult to give an exact answer without knowing all the logic.
------------------------------
George
Original Message:
Sent: 11-28-2018 12:50 PM
From: Shubho Ghosal
Subject: Getting out of the range defined for STET on whole cube
This is part of the process of implementing an IRR function in TM1.
Is there a way to get out of the range defined for a whole cube while using the STET function such as below?
[]=IF(!IRR Iterations @= '1', CONTINUE, STET);
Rule 1
Rule 2
Rule 3
(Get out of the above range defined such that we can look at the entire cube again and define a different set of rules; after getting out, apply a similar condition again for the next iteration.)
[]=IF(!IRR Iterations @= '2', CONTINUE, STET);
Rule 4
Rule 5
etc.
I am attempting this in order to apply a repetitive set of IF statements for every metric.
------------------------------
Shubho Ghosal
------------------------------
#PlanningAnalyticswithWatson