Page 1 of 1

Ordering dimension names in rules

Posted: Mon Jun 25, 2012 12:35 pm
by conflax
Hi there,

I am relatively new to TM1, have been developing a model for a few weeks now and learning on the job.
I am confused with the ordering of dimensions in rules and just need a quick explanation please?


I inherited a model which (among others) included the following 2 cubes and rule :-

Cube1 : Earnings (source cube for this rule)
Dimensions:
Year and Month
Earnings Year and Month
Products
Measures
Version

Cube2 : Revenue (destination cube for this rule)
Dimensions:
Year and Month
Products
Measures
Version

The key rule in the Revenue cube is as follows :-
['Earned Premium']=N:DB('Earnings', 'All Policy Months', !year and month, !Products, 'Earned Premium', !Version);


This worked fine. However when I rebuilt the two cubes myself, I unintentionally changed the order of the Earnings cube dimensions to :-
Earnings Year and Month
Products
Measures
Version
Year and Month

... and this way round the rule no longer calculated (presented zeroes). I realised my ordering error and used "Re-order dimensions" to fix it, but this had no effect on the rule. In the end I had to delete the cube and rebuild it, and re enter my data.


Can the initial order not be changed once a cube is created, and is this fundamental to the rules as I thought it was driven by the name, not the order?

Thanks

Re: Ordering dimension names in rules

Posted: Mon Jun 25, 2012 1:18 pm
by lotsaram
conflax wrote: ... The key rule in the Revenue cube is as follows :-
['Earned Premium']=N:DB('Earnings', 'All Policy Months', !year and month, !Products, 'Earned Premium', !Version);

This worked fine. However when I rebuilt the two cubes myself, I unintentionally changed the order of the Earnings cube dimensions to :-
Earnings Year and Month
Products
Measures
Version
Year and Month

... and this way round the rule no longer calculated (presented zeroes). I realised my ordering error and used "Re-order dimensions" to fix it, but this had no effect on the rule. In the end I had to delete the cube and rebuild it, and re enter my data.

Can the initial order not be changed once a cube is created, and is this fundamental to the rules as I thought it was driven by the name, not the order?

Thanks
Hi there. You're in luck as there are a few regular posters here who have many years experience with doing complex underwriting models in TM1. However I don't think you're at that point yet and your needs right now are more basic and fundamental!

1/ Initial dimension order of a cube is fundamental and cannot be changed once set. The "re-ordering" option is for performance optimization in the backend database only. All GellGet, CellPut, DBRW and DB references must always use the original ordering in which the cube was built
2/ Within a rule the square bracket notation used in the area statement (LHS) or RHS of a rule equation doesn't care about dimension order, the rule engine searches the dimensions for a match and automatically resolves the order, but within a DB() reference used for inter-cube rules the order given must be as per initial cube ordering

Re: Ordering dimension names in rules

Posted: Mon Jun 25, 2012 3:26 pm
by conflax
Thanks yes still trying to get the basics right first

Cheers