A Couple of Rules Questions...

Post Reply
John Hammond
Community Contributor
Posts: 300
Joined: Mon Mar 23, 2009 10:50 am
OLAP Product: PAW/PAX 2.0.72 Perspectives
Version: TM1 Server 11.8.003
Excel Version: 365 and 2016
Location: South London

A Couple of Rules Questions...

Post by John Hammond »

1. ['CSR Gross Margin', 'Actual'] = ['CSR Sales', 'Actual'] + ['CSR Cost of Sales', 'Actual'];

Is there any trick in the rules editor or TM1, I can use to determine which of the Dimensions in the cube 'CSR Gross Margin' belongs to. Obviously there is a bit of common sense or scanning the dimension but I can't see an easy way to establish the dimension otherwise. (Could also write a TI proc that you pass arguments cube,element and then it would iterate through the dims of the cube and then search each dim, but I think that is overkill).

2. Logically feeders should immediately follow rules (except obviously when you have external feeders) but in TM1 it seems you have to have a feeders section and then it is difficult to see which feeders apply to which rules. I tried doing something like this...

Code: Select all

# (R1) - rule 1 NB you cant do inline comments
['% Gross Margin before Warranty'] = (['dimChartofAccounts':'Warranty'] + ['CSR Gross Margin'])\['Selling Price'];
# (R2) 

feeders;
# (R1)
['CSR Gross Margin' ] => ['% Gross Margin before Warranty'];
['dimChartofAccounts':'Warranty'] => ['% Gross Margin before Warranty'];
# (R2)

Ideally you would not need the feeders statement since the feeder syntax is completely different from the equality statement and you could just put the feeders immediately after the calc. Does anyone have a good strategy for tying in calcs to their feeders?

As usual thank you to everyone for their answers and Thanks into particular for Alan who answered my earlier question about dimension sorting.
David Usherwood
Site Admin
Posts: 1458
Joined: Wed May 28, 2008 9:09 am

Re: A Couple of Rules Questions...

Post by David Usherwood »

1. Why not paste the dimension names into Excel and write some dimix formulae?

2. Since feeders can cover several rules, I'm dubious about the idea of interleaving them. Anyway IBM/Cognos/Applix/Manny have done them this way and it's unlikely to change.
You could tighten up your code a bit by creating a total line
Workings for Gross Margin
--Warranty
--CSR Gross Margin
and then

Code: Select all

# (R1) - rule 1 NB you cant do inline comments
['% Gross Margin before Warranty'] = ['Workings for Gross Margin'])\['Selling Price'];
# (R2)

feeders;
# (R1)
['Workings for Gross Margin' ] => ['% Gross Margin before Warranty'];
# (R2)

It doesn't look much but when you get very long rule files (I wrote one on a recent project which prints out at 40 pages) every little helps. Also rollups are (per Paul Simon) 100x faster than + or - in rules.
Post Reply