Page 1 of 1

Year to Month Mapping

Posted: Tue Oct 20, 2009 1:48 am
by David
Hi All,

I am trying to create a rule to transfer the yearly rate from one cube into another cube where the timescale dimension is month in mmm-yy format. Right now, I have to hardcode the month and I am hoping there is an easy way to achieve these by a lookup or something.

Code: Select all

[{'Jan-10','Feb-10','Mar-10','Apr-10','May-10','Jun-10','Jul-10','Aug-10','Sep-10','Oct-10','Nov-10','Dec-10'},'G&A Rate']=N:DB('_Burden Rates','2010','G&A');
[{'Jan-11','Feb-11','Mar-11','Apr-11','May-11','Jun-11','Jul-11','Aug-11','Sep-11','Oct-11','Nov-11','Dec-11'},'G&A Rate']=N:DB('_Burden Rates','2011','G&A');
The timescale dimension has an attribue named Year where identify the year for the month.

Thanks,

David

Re: Year to Month Mapping

Posted: Tue Oct 20, 2009 7:13 am
by David Usherwood
Not Y3K compliant :) but
['G&A Rate']=N:
DB('_Burden Rates',
'20' | subst(!Month,5,2),
'G&A')
;
Would work.
Better way would be to put a year attribute on the Month dimension and use that.

Re: Year to Month Mapping

Posted: Tue Oct 20, 2009 11:28 am
by David
Dave thank you! It works. BTW, I do have a year attribute on the Month dimension, but not kind sure how to make it work. Do you mind putting the code for me using the attribute? Thanks again.

Re: Year to Month Mapping

Posted: Tue Oct 20, 2009 8:03 pm
by David Usherwood
Think

['G&A Rate']=N:
DB('_Burden Rates',
attrs('Month',!Month,'Year'),
'G&A')
;

Would be about right.