Page 1 of 1

DB from a combined dimension to two seperate dimensions?

Posted: Sat Oct 02, 2010 3:25 pm
by MathiasBeckers
Hi,

In Cube A I'm combining year and month in the elements: 'Jan-10', 'Feb-10', ... In Cube B I'm using seperate dimensions for both month and year.
The key now is to get the figures from Cube A into Cube B, given that all other dimensions are present in both cubes. I could write a rule for every year-month combination seperately so that I can target the combinations in Cube A, but I would have to repeat this for every year-month combination.

[Measure, 'Jan', '2010'] = N: DB ('Cube A', !Dimension 1, !Dimension 2, ..., 'Jan-10');
[Measure, 'Feb', '2010'] = N: DB ('Cube A', !Dimension 1, !Dimension 2, ..., 'Feb-10');
...

Is there a way to add attributes for year and month in the year-month dimension and use them in the rules? Because I don't think that this will work:

['Measure', ATTRS('Year-Month', !Year-Month, 'Year'), ATTRS('Year-Month', !Year-Month, 'Month)] = N: DB('Cube A', !Dimension 1, !Dimension 2, ..., !Year-Month);

It's probably not possible to go from a combined dimension in a first cube to two seperate dimensions in a second one, but I wanted to check if there wasn't another workaround before writing all seperate rules.

Thanks,
Mathias

Re: DB from a combined dimension to two seperate dimensions?

Posted: Sat Oct 02, 2010 5:39 pm
by kpk
Hello,

It is possible both with clever naming or with attributes:

1. [Measure] = N: DB ('Cube A', !Dimension 1, !Dimension 2, ..., ATTRS('Year-Month', !Year-Month, 'Month')|'-'|ATTRS('Year-Month', !Year-Month, 'Year'));

2. If you change the naming of the year or the year-month dimension a bit you can simpy concatenate:
[Measure] = N: DB ('Cube A', !Dimension 1, !Dimension 2, ..., !Month|'-'|!Year);

3. With the current naming it is a bit longer:
[Measure] = N: DB ('Cube A', !Dimension 1, !Dimension 2, ..., !Month|'-'|SUBST(!Year,3,2));

HTH

Peter

Re: DB from a combined dimension to two seperate dimensions?

Posted: Mon Oct 11, 2010 1:26 pm
by MathiasBeckers
Thanks,

Great help! Didn't know you could combine ATTRS functions like that.
I will test it as soon as I get the chance.