Page 1 of 1

Copy data from one cube to another

Posted: Wed Jul 23, 2014 5:47 am
by jgd108
Hello All,

I have a requirement to copy data from one cube dimension element into a different cube but divide the data among different elements of a dimension.
In case that's not clear, Say in Cube ABC, I have 'amount' 100 for 'Department ID' 001. I want to load this 100 amount into my another cube XYZ
for 'Department ID' 001, but divide it(100) equally for each employee (in Employee dimension) (say 5 employees are in Dept 001). So Emp1 will have amount 20, Emp2 will have 20 and so on..

My current situation is, I am able to load 'amount' 100 for Department ID 001 from cube ABC into cube XYZ for Department ID 001, but its 100 for each employee.Which Is not right. I want 100 to get divided among employees for each Department ID.
The data in Cube XYZ should be like this : (But currently it's 100 for each employee in Department 1)
Amount
Department ID Employee
1 10001 20
10002 20
10003 20
10004 20
10005 20

Can you give me a hint how to do it using TI. :idea:
Thanks.

Re: Copy data from one cube to another

Posted: Wed Jul 23, 2014 6:18 am
by BariAbdul
Hi jgd108,This might help.

http://www.tm1forum.com/viewtopic.php?f=3&t=9643 Thanks

Re: Copy data from one cube to another

Posted: Thu Jul 24, 2014 4:55 am
by rksharmatm1
Hi jgd108,

create an attribute for each employee as 'Dept' (which will store which dept an employee belong to)
create an attribute 'Noofemployee' in Dept dimension, to store information about no.of.employees in a department. ( this can also be stored in a cube)

Now, following rule could be used in Cube XYZ

['Amount'] = N :
IF( !Dept @= ATTRS('Employee',!Employee,'Dept'),
(DB('ABC', ATTRS('Employee',!Employee,'Dept'),'Amount') ###: this will give Total amount of that dept to which an employee belong to.
/
ATTRN('Dept',!Dept,'Noofemployee') #### : this will give no. of employee in that department.
),0);

Assumption: Cube ABC have only 2 dims - dept and measure dim.

Re: Copy data from one cube to another

Posted: Thu Jul 24, 2014 9:18 am
by BariAbdul
I may be quite off the mark here but you could also try this,take a view as a source and you could input the value by using CellGetN and then distributing the retrived value by using function CellPutProportionalSpread for example : CellPutProportionalSpread( value, cube, e1, e2, e3...,en ); Thanks