Page 1 of 1

Copy element attributes from one dimension to another

Posted: Fri Jan 24, 2020 3:33 pm
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;

Re: Copy element attributes from one dimension to another

Posted: Fri Jan 24, 2020 3:41 pm
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.

Re: Copy element attributes from one dimension to another

Posted: Fri Jan 24, 2020 3:43 pm
by lynnsong986
Thank you so much for your help! I'm going to try it out!