Feeders for Balance Calculations

Post Reply
PlanningDev
Community Contributor
Posts: 349
Joined: Tue Aug 17, 2010 6:31 am
OLAP Product: Planning Analytics
Version: 2.0.5
Excel Version: 2016

Feeders for Balance Calculations

Post by PlanningDev »

Ive searched for feeding balances across the board but I still can't seem to figure out the best way to feed what Im trying to do.

The cube has a month dimension and a year dimension.

The rule is written such that there is a STET for Jan and 2008 which is where I have to manually enter the balance to get it started.
The issue then is that for all other months and years the rule picks up the prior months number and adds to it. The rule for this works but how do I feed the calculated items when the only hand entered item is in Jan 2008?

The below code doesn't work and Ive tried variation of it as well.

Code: Select all

['Subs','Jan','2008']=>['Subs'];
David Usherwood
Site Admin
Posts: 1458
Joined: Wed May 28, 2008 9:09 am

Re: Feeders for Balance Calculations

Post by David Usherwood »

Think you need to have a Year total in the Month dimension and feed to that:

Code: Select all

['Subs','Jan']=>['Year'];
Wim Gielis
MVP
Posts: 3241
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Feeders for Balance Calculations

Post by Wim Gielis »

Hello

You can have a text attribute on the month dimension, containing the 'next month'.

Then, use a DB() function on the right hand side of the feeder. For the month argument, feed to that next month (ATTRS(dim, !elem, 'next month'))

Don't forget to feed to the next year if you are on the 'December element'.

Wim
Best regards,

Wim Gielis

IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
tomok
MVP
Posts: 2836
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: Feeders for Balance Calculations

Post by tomok »

This is pretty simple, the only requirement is that you have a rollup in both the month and year dimension that add up all the n-level elements, if you don't already. For example, you need a "Year" element in the month dimension that is a sum of all the months (or a sum of the quarters which is a sum of the months). Then you need an element in the Year dimension that adds all the years together like "All_years". It doesn't matter that this element doesn't make sense from a data standpoint, you're only going to use it in the feeder code. Then the feeder statement would look like this:

['Subs','Jan','2008']=>['Subs','Year','All_years'];

No need for any special attributes or anything like that. This feeder will not need updating. Just make sure to add any new years you add to Year dimension to the "All_years" node whenever you do maintenance on the dimension.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
PlanningDev
Community Contributor
Posts: 349
Joined: Tue Aug 17, 2010 6:31 am
OLAP Product: Planning Analytics
Version: 2.0.5
Excel Version: 2016

Re: Feeders for Balance Calculations

Post by PlanningDev »

Im not sure if I did this right but it ultimately took 3 feeder statements.
1. Had to feed the year where the primer entry was manually entered (Jan, 2008)
2. Had to feed Dec of prior to Jan of current year
3. Had to feed current year Jan through Dec

I do realize that I can target sub total with a feeder which feeds all the N levels. In this sense, I wanted to know how to answer this problem without creating a dummy rollup in the years dimension in order to have a feeder target for all years.

Assuming I don't have a rollup for years does having 3 feeders for what im doing seem to make sense?
Gregor Koch
MVP
Posts: 263
Joined: Fri Jun 27, 2008 12:15 am
OLAP Product: Cognos TM1, CX
Version: 9.0 and up
Excel Version: 2007 and up

Re: Feeders for Balance Calculations

Post by Gregor Koch »

Hi
:shock:
Still coughing up coffee after reading this from the previous post:

['Subs','Jan','2008']=>['Subs','Year','All_years'];

Which is basically the worst overfeeding you can do in this example, just to mention that you are unnecessarily feeding all years prior to 2008 as well.

You don't necessarily need to create a 'All Years' (or 'All Months' for that matter) to feed your rule, let alone that it is not recommendable to use especially ‘All Years’ in the first place.
The way you write a Feeder for this is also dependent on how many years out (in the future) you want to actually feed and I would put in a condition in your feeder which checks this.
If you need to push your Balance 20 Years out (eg in a Mining Model) then maybe you should consider a different way of writing your feeder.

I usually create a 'Time' cube which creates an Index for any Month-Year combination. This usually has the Year, Month and a Measure dimension. In this I also store the following and previous Month for a Month and the following and previous Year for a Month-Year combination. With that I can easily say that the month I need to feed from, say, Dec-2008 feeds Jan-2009 (or usually Opening Balance but that depends on whether you store the balance or the movement against the Month element) and also whether a month is in a certain range.

But let’s just say you only need to feed 5 Years because that was the scope of your Budget then a feeder like this will work just fine.

['Subs']=>DB(
IF(Range of Index comparison ,cubename,’’),DB(‘Time’, !Year, !Month, ‘Next Year’), DB(‘Time’, !Year, !Month, ‘Next Month’), ‘Subs’);

I have simplified the comparison of the indexes. It basically says: check whether the feeding month is greater or equal to Jan 2008 and less than say Dec 2012.
You could also leave 'Jan', '2008' in the left side which possibly would improve start up and rule save time but unless it is an issue I'd opt not to hard code a year in a rule.
If you do feel comfortable to have a go at conditional feeders and the above assumption of the scope is fitting then post the full dimensionality of your cube(s) and I am happy to assist.

Cheers
Gregor Koch
MVP
Posts: 263
Joined: Fri Jun 27, 2008 12:15 am
OLAP Product: Cognos TM1, CX
Version: 9.0 and up
Excel Version: 2007 and up

Re: Feeders for Balance Calculations

Post by Gregor Koch »

And, yes, I am aware that you could create a consolidation in the year dimension which only has years in it which need to be fed.
Cheers
Post Reply