Time dimension consolidation - help with rules needed
-
- Posts: 30
- Joined: Mon Oct 03, 2011 9:18 pm
- OLAP Product: TM1
- Version: 10.2.2fp6
- Excel Version: 2016
Time dimension consolidation - help with rules needed
Many of you with Cognos Enterprise Planning experience remember 'First Period' and 'Last Period' settings. They were very useful for working with all sorts of opening and closing balances.
I tried to model this behavior using attributes. My real life cube has several big dimensions. I made a very simple demo cube with following dimensions: time, managers, turnover (calculation dimension). I made several rules and defined several attributes. I have an issue with consolidation, it is highlighted. You can see it all on attached screenshot.
I tried to experiment with filling up 'first' and 'last' attributes of months, but it resulted in wrong results or circular references. I think I finally found a way to solve the problem. I uncommented the line with 'ConsolidateChildren' instruction. The result can be seen on this screenshot. It seems to work.
I tried to apply this solution to my real life task and discovered that my cube recalculate time changed from split second to 4-5 seconds. I am convinced that the solution I found is not optimal. Can you share some best practice advice? I am sure this situation if far from unique, and there must be a better solution.
I tried to model this behavior using attributes. My real life cube has several big dimensions. I made a very simple demo cube with following dimensions: time, managers, turnover (calculation dimension). I made several rules and defined several attributes. I have an issue with consolidation, it is highlighted. You can see it all on attached screenshot.
I tried to experiment with filling up 'first' and 'last' attributes of months, but it resulted in wrong results or circular references. I think I finally found a way to solve the problem. I uncommented the line with 'ConsolidateChildren' instruction. The result can be seen on this screenshot. It seems to work.
I tried to apply this solution to my real life task and discovered that my cube recalculate time changed from split second to 4-5 seconds. I am convinced that the solution I found is not optimal. Can you share some best practice advice? I am sure this situation if far from unique, and there must be a better solution.
-
- 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: Time dimension consolidation - help with rules needed
Out of interest why haven't you created "closing balance" as a consolidation?
TM1 Consolidations will (almost) always calculate quicker than a rule.
Other than that you are correct and this has been discussed a number of times and searching the forum will give you a few pointers.
TM1 Consolidations will (almost) always calculate quicker than a rule.
Other than that you are correct and this has been discussed a number of times and searching the forum will give you a few pointers.
Declan Rodger
-
- Posts: 30
- Joined: Mon Oct 03, 2011 9:18 pm
- OLAP Product: TM1
- Version: 10.2.2fp6
- Excel Version: 2016
Re: Time dimension consolidation - help with rules needed
In my task the calculation dimension is quite big with a lot of elements and calculations, so I tried to keep it plain and simple at first. Now I decided to check if I could move some rules to consolidations, and it appeared that I could.
Back to my demo cube. I applied consolidation logic to closing balance. It made one rule obsolete, but took my ability to create different rules for N and C levels, as 'closing balance' is now always C level. So I had to become creative. This is the best I could manage so far. I moved this logic to my main task and it works fast, so I am mostly happy.
How can it be improved further?
Back to my demo cube. I applied consolidation logic to closing balance. It made one rule obsolete, but took my ability to create different rules for N and C levels, as 'closing balance' is now always C level. So I had to become creative. This is the best I could manage so far. I moved this logic to my main task and it works fast, so I am mostly happy.
How can it be improved further?
-
- 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: Time dimension consolidation - help with rules needed
ConsolidateChildren() is a very useful function but if it's not completely necessary I would tend to avoid it and I think in your case putting an IF statement into you opening balance calculation at C-level to just use standard TM1 consolidation where the Managers dimension is a consolidation would save you having to use it.Sighurd wrote:In my task the calculation dimension is quite big with a lot of elements and calculations, so I tried to keep it plain and simple at first. Now I decided to check if I could move some rules to consolidations, and it appeared that I could.
Back to my demo cube. I applied consolidation logic to closing balance. It made one rule obsolete, but took my ability to create different rules for N and C levels, as 'closing balance' is now always C level. So I had to become creative. This is the best I could manage so far. I moved this logic to my main task and it works fast, so I am mostly happy.
How can it be improved further?
Declan Rodger
-
- Posts: 30
- Joined: Mon Oct 03, 2011 9:18 pm
- OLAP Product: TM1
- Version: 10.2.2fp6
- Excel Version: 2016
Re: Time dimension consolidation - help with rules needed
During my previous experiments I noticed productivity drop when ConsolidateChildren() was used, so I would be happy to get rid of it. As of now I need to put ConsolidateChildren() for all my non-time dimensions, and I don't like it, I would prefer standard consolidation if possible. What kind of IF statement you think I should insert into C-level of opening balance calculation?declanr wrote: ConsolidateChildren() is a very useful function but if it's not completely necessary I would tend to avoid it and I think in your case putting an IF statement into you opening balance calculation at C-level to just use standard TM1 consolidation where the Managers dimension is a consolidation would save you having to use it.
-
- MVP
- Posts: 3652
- Joined: Fri Mar 13, 2009 11:14 am
- OLAP Product: TableManager1
- Version: PA 2.0.x
- Excel Version: Office 365
- Location: Switzerland
Re: Time dimension consolidation - help with rules needed
You are taking the wrong approach, you shouldn't need consolidate children at all. Typically CB is a consolidation of OB and period movements. Depending on the model and source system OB can either be data entry for each period or rule calculated (and fed, which seemed to be your 1st problem) as the CB of the previous period. This reduces everything to a N level rule to calculate the OB. Where you might need rules is to override the natural consolidation so that balances display the balance value and not an accumulation. Normally you do this with a lookup of the last N period in the consolidation. However this is something that you need to do for overriding consolidation (C rule only) for the time dimension, usually you wouldn't need to do this for the business dimensions as these should consolidate.Sighurd wrote:During my previous experiments I noticed productivity drop when ConsolidateChildren() was used, so I would be happy to get rid of it. As of now I need to put ConsolidateChildren() for all my non-time dimensions, and I don't like it, I would prefer standard consolidation if possible. What kind of IF statement you think I should insert into C-level of opening balance calculation?
-
- Posts: 30
- Joined: Mon Oct 03, 2011 9:18 pm
- OLAP Product: TM1
- Version: 10.2.2fp6
- Excel Version: 2016
Re: Time dimension consolidation - help with rules needed
I'd like to avoid it too. I was overly optimistic yesterday, performance problems returned. If I turn off 'consolidate children' rules, they are gone.lotsaram wrote: You are taking the wrong approach, you shouldn't need consolidate children at all.
But then I have this problem.
In my last screenshot CB is a consolidated item, I have a feeder, which I am not sure is right.Typically CB is a consolidation of OB and period movements. Depending on the model and source system OB can either be data entry for each period or rule calculated (and fed, which seemed to be your 1st problem) as the CB of the previous period.
Code: Select all
['closing balance']=>DB('turnover',ATTRS('months',!months,'next'),!managers,'opening balance');
Currently I do it using 'first' and 'last' attributes in time dimension. Do you mean that I have to look up for first or last period of consolidated item with a rule?This reduces everything to a N level rule to calculate the OB. Where you might need rules is to override the natural consolidation so that balances display the balance value and not an accumulation. Normally you do this with a lookup of the last N period in the consolidation.
My problem seems to be on leaf levels of time dimension (months) AND aggregated levels of other dimensions (managers). OB tries to use C:level calculation, but month on leaf level does not have 'first' attribute. If it had, it would create circular reference. So I need to use a different approach, obviously.However this is something that you need to do for overriding consolidation (C rule only) for the time dimension, usually you wouldn't need to do this for the business dimensions as these should consolidate.
-
- 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: Time dimension consolidation - help with rules needed
Why are you making this so difficult? This is a very common scenario, I've used it on multiple occasions without issue. It should work fine like this:
Code: Select all
skipcheck;
['jan','opening balance'] = STET:
['opening balance'] = N:db('turnover',ATTRS('months',!months,'prev'),!managers,'closing balance');
feeders;
['closing balance'] => db('turnover',ATTRS('months',!months,'next'),!managers,'opening balance');
-
- Posts: 30
- Joined: Mon Oct 03, 2011 9:18 pm
- OLAP Product: TM1
- Version: 10.2.2fp6
- Excel Version: 2016
Re: Time dimension consolidation - help with rules needed
I agree it's very common. I make it so difficult because I am only learning, and don't know all efficient approaches and best practices. Additionally, Enterprise Planning experience takes it's toll sometimes.tomok wrote:Why are you making this so difficult? This is a very common scenario, I've used it on multiple occasions without issue.
This happens if I leave only what you wrote.
This is my next iteration. I got rid of 'ConsolidateChildren', added one more check for opening balance (OB) in the earliest periods, and made OB rule universal for N: and C: levels. Seems to work just fine. Going to test it on my real task to see if it works fast enough.
-
- 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: Time dimension consolidation - help with rules needed
Didn't know that you were expecting to look at quarters and the year separately. You just need one off rules for each quarter and then the year:
You need to make sure this line is in your TM1S.cfg file:
AllowSeparateNandCRules=T
Code: Select all
['Q1','opening balance'] = C:['jan','opening balance'];
['Q2','opening balance'] = C:['apr','opening balance'];
['Q3','opening balance'] = C:['jul','opening balance'];
['Q4','opening balance'] = C:['oct','opening balance'];
['Year','opening balance'] = C:['jan','opening balance'];
AllowSeparateNandCRules=T