Copy element attributes from one dimension to another

Post Reply
lynnsong986
Posts: 83
Joined: Wed Feb 28, 2018 2:20 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2016

Copy element attributes from one dimension to another

Post by lynnsong986 »

Hello,

I have a dimension "Company_BU" where each BU is rolled up into a company. another dimension "BU" has only the BUs not company. I need to copy the Alias attributes of the "Company_BU" dimension to the "BU" dimension. I found some codes on this forum but my dimensions have different levels. I'm not sure how to deal with control cubes (with normal cubes I would create a view and copy data over but doesn't seem to work here).

in the TI, I had a subset named "BU" as data source, which includes level-zero-only elements in the Company_BU dimension (probably this part is wrong already?).
these are the codes provided on this forum, I don't know how to tweak it to suit my purpose here. Thank you so much in advance!

cDimF = 'Company_BU';
cDimT = 'BU';

cDimA= '}ElementAttributes_' | cDimF;

iAttr = DIMSIZ(cDimA);

i=1;

WHILE (i <= iAttr);

vType= SUBST(DTYPE(cDimA, DIMNM(cDimA, i)),2,1);

ATTRINSERT(cDimT, '', DIMNM(cDimA, i), vType);
AttrPuts(DIMNM(cDimA, i), cDimT, vBU, 'Name');
i=i+1;

END;
Attachments
data source in TI.PNG
data source in TI.PNG (20.9 KiB) Viewed 1630 times
BU attributes.PNG
BU attributes.PNG (14 KiB) Viewed 1630 times
Company_BU attributes.PNG
Company_BU attributes.PNG (22.03 KiB) Viewed 1630 times
tomok
MVP
Posts: 2832
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: Copy element attributes from one dimension to another

Post by tomok »

lynnsong986 wrote: Fri Jan 24, 2020 3:33 pm I'm not sure how to deal with control cubes (with normal cubes I would create a view and copy data over but doesn't seem to work here).
Not sure where you are getting this idea. Control cubes are just cubes. You can create views on them AND you can most certainly use those views as a data source in a TI process.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
lynnsong986
Posts: 83
Joined: Wed Feb 28, 2018 2:20 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2016

Re: Copy element attributes from one dimension to another

Post by lynnsong986 »

Thank you so much for your help! I'm going to try it out!
Post Reply