Page 1 of 1

Pulling values from other cubes using rules.

Posted: Tue Sep 20, 2011 1:58 pm
by ravi.ahuja21
Hi Folks,

I am trying to pull values from one cube to another. Here is the scenario.

I have two cubes one is the main cube named 'All Expense' having these dimensions
Function
Department
Central Nature
Scenario
Facility
Year
Months
Expense Measures

I am pulling values from an other cube named as 'Long term disability Insurance' having the dimensions listed below into the 'All Expense' cube
Function,
Facility
Year
Scenario
Employee(Attributes:Facility(text),Department(Text)).
Employee Insurance Measure

Now the department resides in the attribute of the employee dimension and i want to pull the details of only the departments pertaining to the employee.

This piece of code works fine but I am not sure if it will give me the results as expected.

['Amount LC']=N:DB('Long Term Disability Insurance',!Function,!Facility,!Year,'Budgeted',!Department,'Employer Premium LC');

I get error when i try to do something like this.

['Amount LC']=N:DB('Long Term Disability Insurance',!Function,!Facility,!Year,'Budgeted',ATTRS('Employee',!Employee,'Department'),'Employer Premium LC');


Really confused as to how to retrieve the values in such cases or do I have to put another dimension in the 'Long Term Disability Insurance cube'?

I Request someone to kindly help me in this regards.

Thanks,
Ravi Ahuja.

Re: Pulling values from other cubes using rules.

Posted: Tue Sep 20, 2011 2:08 pm
by jim wood
Employee as a dimension only exists in the cube that you are getting data from. You can only get attributes from dimensions for the cube that rule is attached to. That's your problem.

Re: Pulling values from other cubes using rules.

Posted: Tue Sep 20, 2011 2:34 pm
by qml
The easiest solution would be to create new consolidations in the Employee dimension, grouping Employees into the same departments that are then used in the Department dimension in the second cube. Your first rule would then work nicely and there would be no need to use attributes either.

And you can't really use attributes of the Employee dimension in that way, because !Employee will not be resolved properly in the context of the target cube as it does not have that dimension.

Re: Pulling values from other cubes using rules.

Posted: Tue Sep 20, 2011 3:09 pm
by jim wood
qml wrote:And you can't really use attributes of the Employee dimension in that way, because !Employee will not be resolved properly in the context of the target cube as it does not have that dimension.
Is it me or did I just say that??? Probably me.

Re: Pulling values from other cubes using rules.

Posted: Tue Sep 20, 2011 4:16 pm
by ravi.ahuja21
still it will not be dynamic as i want, because if i create a consolidation for department it would be something like this.

['Amount LC','<A department code>']=N:DB('Long Term Disability Insurance',!Function,!Facility,!Year,'Budgeted','<A department code>','Employer Premium LC');


I will have to hard code this which i want to avoid because I have a big list of departments.

Likewise is the case with the Chart of accounts which gets stored in the respective employee attribute. Is there a way around for this?

Re: Pulling values from other cubes using rules.

Posted: Tue Sep 20, 2011 4:44 pm
by qml
ravi.ahuja21 wrote:I will have to hard code this which i want to avoid because I have a big list of departments.
No, you won't. There are ways of keeping the rule generic, for example create an attribute for Department (and set its value to something for those Departments that you want to pull data from the other cube) and then check on the right hand side of that rule using an IF statement if a given Department has that attribute set to something. If yes, calculate rule, if not, stet or whatever.
jim wood wrote:Is it me or did I just say that??? Probably me.
Am I not allowed to have the same opinion? ;) Especially if it's the right opinion? :geek:

Re: Pulling values from other cubes using rules.

Posted: Tue Sep 20, 2011 5:41 pm
by jim wood
qml wrote:Am I not allowed to have the same opinion? ;) Especially if it's the right opinion? :geek:
Of course you're allowed. Sometimes my mind and fingers disconnect so what I mean to say doesn't actually come out the way I mean to say it. I have to check these things sometimes.