Rules for Month allocation with start and finish dates
Posted: Wed Jan 05, 2011 6:14 am
Hi, will try and keep this simple
I have a cube that users input values, then can also enter start month and end month (no dimension for months in this cube)
This value/12 is allocated to a further cube with an extra month dimension. Also based on start and end month.
Trying to find the best, simplist method for doing this allocation through cube rules. Since the source cube doesnt have months I have difficulty in setting rules without repeating 12 times (one for each month). Any suggestions welcome
eg Jan only example below - would prefer not to repeat
I have a cube that users input values, then can also enter start month and end month (no dimension for months in this cube)
This value/12 is allocated to a further cube with an extra month dimension. Also based on start and end month.
Trying to find the best, simplist method for doing this allocation through cube rules. Since the source cube doesnt have months I have difficulty in setting rules without repeating 12 times (one for each month). Any suggestions welcome
eg Jan only example below - would prefer not to repeat
Code: Select all
#COMPARE START AND END MONTH WITH TARGET AREA MONTH
['Value' ,'Jan'] =N: If (DIMIX( 'Month',(DB('Input cube', !dim1, !dim2, !dim3, 'Start Month')))
< DIMIX( 'Month', 'Jan') %
(DIMIX( 'Month',(DB('Input cube', !dim1, !dim2, !dim3, 'End Month'))))
> DIMIX( 'Month', 'Jan'),
#THEN 1/12 value applied
DB('Input cube', Dim1,DIm2, Dim3, 'Value)/12,
# ELSE continue to next month
CONTINUE);