Page 1 of 1

Uneven Dimension # :Cube Transfer from 1 Cube to Another

Posted: Wed Oct 28, 2009 10:14 am
by appleglaze28
I'd like to ask how this can be done. I have a source cube with 4 dimensions like Position-Department, Year, Version and Measure. I have a destination cube with 6 dimension, Department, Shift, Month, Year, Version & Measure. I plan to link the data field, Shift & Time from the source cube to the destination cube. I'm having like issues as well on how to correctly do it since the element linking the Position-Department to Department is the ELPAR of the source dimension.

So I tried writing this command:

Code: Select all

['New Employees']=DB('New_Headcount_Cost',ELPAR('Title',!Title,2),DB('New_Headcount_Cost',ELPAR('Title',!Title,2),!Year,!Version,'Month')!Year,!Version,'Shift');

Re: Uneven Dimension # :Cube Transfer from 1 Cube to Another

Posted: Wed Oct 28, 2009 10:45 am
by jim wood
Have you considered using a look up cube for this rather than using elpar in the rule? Doing this might be easier to maintain and also help you split the process in to steps that might help you identify the error?

Re: Uneven Dimension # :Cube Transfer from 1 Cube to Another

Posted: Wed Oct 28, 2009 12:47 pm
by Steve Rowe
It's also worth pointing out that using Elpar in rules is very unreliable and not really recommended (by me anyway :roll: ) This is because of the index in the function and the multiple hierarchies in the dimension. There is no way to control which hierarchy is "2" and just because the hierarchy for one element is "2" this does not mean it will be 2 for all elements in the dimension. As well as that problem it's not stable and I have seen the hierarchy that was "1" become "2".

Setting up the attributes is the way to go. It should make the rule faster too.

That said your rule looks wrong, did you mis-paste it?

['New Employees']=N:DB('New_Headcount_Cost',!Department,!Year,!Version,'Month');

Should just work. Even though Department is not in the in the headcount cost cube, the N levels of Department are in the Titles dimension so the match will still work. I think that you would need to put more elements on the left of the rule to specify what is happening with the shift and month dimensions.

The problem you will have is with the feeder from the Headcount cost cube, since feeders only operate at the N level and the N levels of Title are not in the Department dimension the feeders will fail. This is where you need to use Elpar or an attribute.
In the Headcount cost cube you would have something like.
['Month']=>DB('Employee Headcount Measures', Attrs('Title', !Title,'Department'), 'Hardcoded reference to shift',''Hardcoded reference to month', !Year, !Version, 'New Employees');

Hope this gives you an idea of what to do, that’s if I’ve not got the wrong end of the stick.
Cheers

Re: Uneven Dimension # :Cube Transfer from 1 Cube to Another

Posted: Wed Oct 28, 2009 2:08 pm
by jim wood
Just to be clear about one thing though, using attributes and look up cubes is essentially the same thing. It depends on you. I personally prefer look up cubes as they are visable at all times and if somebody else took over the model they can be easier to explain, where as using attributes keeps the whole process nicely tucked away.