What's the right way to feed children?

Post Reply
ParisHilton
Posts: 73
Joined: Fri Apr 23, 2010 11:35 am
OLAP Product: Tm1
Version: 9.5
Excel Version: 2007 2010

What's the right way to feed children?

Post by ParisHilton »

Apologies for the subject line being so open to witty replies but.....


I've got budget data at a monthly level and I want the cube to calculate daily budget values.
I've populated a 'daysinmonth' attribute for every day so I can write a rule that does the calculation.
As a rookie Tm1 developer though, I don't know how best to feed the cells.

A more concrete example is...
Dimension time has
Date attribute(Daysinmonth) attribute(Period)
1-1-2013 31 2013-Jan
2-1-2013 31 2013-Jan
3-1-2013 31 2013-Jan
..
..
..
2013-Jan n/a n/a
2013-Feb n/a n/a

So in my Time dimension I have a mix of dates and 'periods'.

I've got a measure 'BudgetByPeriod' which I've loaded with the monthly values . eg 2013-Jan has a value of 123456
and a rule that looks like

['Budget']=n:(DB('data',!Dim1,!Dim2,ATTRS('Time',!Time,'Period'),'BudgetByPeriod'))/ATTRN('Time',!Time,'DaysInMonth');

Which to me means, for the daily budget figure, lookup the budget for the month and divide it by the number of days in the month.
so Budget should be 123456/31

The problem is, I don't know how to write a feeder that forces a budget calculation at daily level.
The best(terrible) solution I've managed to devise is to have a 'isfed' measure, which I set to 1 for every possible value via TI process.

(Alternatively, I could calculate the budget values daily and load them (or possibly use a TI script to calculate them)).

As always your help is appreciated!

P
“The way I see it, you should live everyday like its your birthday”


TM1 9.5 Cognos BI 8.4 Excel 2007. 128GB Ram. E7450@2.40Ghz -24 core. Fluffy white dog.
declanr
MVP
Posts: 1817
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: What's the right way to feed children?

Post by declanr »

So in your cube you have:

# A time dimension that contains N-Level Days & N-Level Months
# A Measures dimension that contains "Budget for the N-Level Days" & "Budget for the N-Level Months"
# Some other dims that are sort of irrelevant at the moment


In this instance I would ask whether you really need the separate input method in BOTH the time dimension and the measures dimension or would one suffice? e.g.
If you only have the measure "Budget", you know if its against "Jan"; it is the full month figure and if its against "01-01-14" then its the spread down day value.

Anyway regardless of the above, just stick all of the days under a month C-Level element and feed that from the N-Level month e.g.

C - Jan
N - 01-01-14
N - 02-01-14
........
N - 31-01-14

N - Jan Input

Code: Select all

['Jan Input'] => ['Jan'];

EDIT - I would probably use 2 cubes as I find it cleaner that way; the input cube by month and then the daily rule-fed result cube. Many people will however disagree with this but I thought since I had suggested in my reply that you have a few options I may as well give you the method that I would use (and if it doesn't need to be rule driven just use a TI - job done!)
Declan Rodger
ParisHilton
Posts: 73
Joined: Fri Apr 23, 2010 11:35 am
OLAP Product: Tm1
Version: 9.5
Excel Version: 2007 2010

Re: What's the right way to feed children?

Post by ParisHilton »

You've got that dead right declanr; the only problem is that I don't know what the leaf level values are, only the monthly values.
I forgot to say that because I can't load the values to C level, I've created extra elements that represent months. I load the monthly values there and am using attributes to work out what my monthly value is related to each parent. ie

time is REALLY
Jan-2013
1-1-2013
2-1-2013
3-1-2013
.
.
.
BudgetJan2013
BudgetFeb2013

I then calculate 1-1-2013 based on the value in BudgetJan2013. I created an extra measure for the budget figures to avoid a circular reference. I'm thinking , as you suggest, a separate cube is a better option. I still need to feed each daily value though :(
“The way I see it, you should live everyday like its your birthday”


TM1 9.5 Cognos BI 8.4 Excel 2007. 128GB Ram. E7450@2.40Ghz -24 core. Fluffy white dog.
declanr
MVP
Posts: 1817
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: What's the right way to feed children?

Post by declanr »

I then calculate 1-1-2013 based on the value in BudgetJan2013. I created an extra measure for the budget figures to avoid a circular reference. I'm thinking , as you suggest, a separate cube is a better option. I still need to feed each daily value though

You don't need to feed each daily value with a separate feeder, just feed the consolidation of the daily values (the month) and it will feed all of them.

Code: Select all

['BudgetJan2013'] => ['Jan-2013'];

You can even stick an attribute against the budget input month elements to say what they should feed and then just use a 1 line feeder for the whole lot.
Declan Rodger
ParisHilton
Posts: 73
Joined: Fri Apr 23, 2010 11:35 am
OLAP Product: Tm1
Version: 9.5
Excel Version: 2007 2010

Re: What's the right way to feed children?

Post by ParisHilton »

doh!

of course that's the way to do it.

Cheers.
“The way I see it, you should live everyday like its your birthday”


TM1 9.5 Cognos BI 8.4 Excel 2007. 128GB Ram. E7450@2.40Ghz -24 core. Fluffy white dog.
Post Reply