Hi,
I have a dimension say A having certain elements with unbalanced hierarchy.
Now I have a dimension b similar to A with unbalanced hierarchy. Now my requirement is to iterate all elements with in dimension B and add them below dimension A .
SO bascically i will have to take elements in dimnesion b and copy over along with dimension A elements daily.
How do I automate this process. Copy elements from Dimension B and add it to dimension A .
carry forward a dimension elements to another dimension
-
- Posts: 128
- Joined: Tue May 23, 2017 12:45 pm
- OLAP Product: Tm1
- Version: 9.5
- Excel Version: 2010
-
- Community Contributor
- Posts: 287
- Joined: Fri Feb 15, 2013 5:49 pm
- OLAP Product: TM1
- Version: PA 2.0.9.1
- Excel Version: 365
- Location: Minneapolis, USA
Re: carry forward a dimension elements to another dimension
Dimension A is an exact copy of Dimension B, why not use only one dimension? If you must use two dims, you can use a WHILE loop in the prolog or epilog tab of a TI process to spin through all elements in Dimension B and add to Dimension A. Below is sample code for looping through all elements of Dimension B and adding each to Dimension A. You would need additional code if you want to copy the parent/child relationships to Dimension A. You've a couple options for doing that, one would be to evaluate all parents of the element being evaluated, make sure the parent exists in Dimension A, and then add the parent/child relationship. I bet there's other posts in the forum explaining how to that as well as other options for copying parent/child relationships from one dim to another.
Code: Select all
# not debugged, so errors likely present
vDim1 = 'Dimension B';
vDim2 = 'Dimension A';
vLimit = DIMSIZ(vDim1);
index1 = 1;
WHILE(index1 <= vLimit);
vElement = DIMNM(vDim1, index1);
vType = DTYPE(vDim1, vElement);
DimensionElementInsert(vDim2, '', vElement, vType);
index1 = index1 + 1;
END;
-
- Posts: 128
- Joined: Tue May 23, 2017 12:45 pm
- OLAP Product: Tm1
- Version: 9.5
- Excel Version: 2010
Re: carry forward a dimension elements to another dimension
Its not an exact copy , its like appending dimension B to dimension A. DImension B might change some times , so the append process to unwind dimension b elements added to dimension A and readd them daily .
- Elessar
- Community Contributor
- Posts: 340
- Joined: Mon Nov 21, 2011 12:33 pm
- OLAP Product: PA 2
- Version: 2.0.9
- Excel Version: 2016
- Contact:
Re: carry forward a dimension elements to another dimension
If you understand you right, bedrock.dim.clone with pUnwind=2 will solve your task:
https://github.com/cubewise-code/bedroc ... .Clone.pro
https://github.com/cubewise-code/bedroc ... .Clone.pro
Best regards, Alexander Dvoynev
TM1 and Data Science blog: 6th article - PAfE + VBA: Commit each cell without pressing “Commit” button.
TM1 and Data Science blog: 6th article - PAfE + VBA: Commit each cell without pressing “Commit” button.
-
- Posts: 128
- Joined: Tue May 23, 2017 12:45 pm
- OLAP Product: Tm1
- Version: 9.5
- Excel Version: 2010
Re: carry forward a dimension elements to another dimension
hi,
I am adding to dimension A , but I am just appending dimension b to dimension A. But dimension B can change any time and that needs to be reflected on DImension A on daily basis.
So I have to unwind Dim B elements in Dim A daily and then readd dim B elements to dim A .
so to append Dim B to Dim A.
I need a ti that will loop through all the elements of dim b and append it to dim A .
But how do i maintain/bring in the parent child relationship of dim B while appending.
Thanks,
I am adding to dimension A , but I am just appending dimension b to dimension A. But dimension B can change any time and that needs to be reflected on DImension A on daily basis.
So I have to unwind Dim B elements in Dim A daily and then readd dim B elements to dim A .
so to append Dim B to Dim A.
I need a ti that will loop through all the elements of dim b and append it to dim A .
But how do i maintain/bring in the parent child relationship of dim B while appending.
Thanks,
-
- MVP
- Posts: 3116
- Joined: Mon Dec 29, 2008 6:26 pm
- OLAP Product: TM1, Jedox
- Version: PAL 2.0.9.18
- Excel Version: Microsoft 365
- Location: Brussels, Belgium
- Contact:
Re: carry forward a dimension elements to another dimension
Using the functions ElparN and Elpar you can loop over all parents of an element.Analytics123 wrote: ↑Mon Dec 11, 2017 1:58 am hi,
I am adding to dimension A , but I am just appending dimension b to dimension A. But dimension B can change any time and that needs to be reflected on DImension A on daily basis.
So I have to unwind Dim B elements in Dim A daily and then readd dim B elements to dim A .
so to append Dim B to Dim A.
I need a ti that will loop through all the elements of dim b and append it to dim A .
But how do i maintain/bring in the parent child relationship of dim B while appending.
Thanks,
That way, you can DimensionElementComponentAdd an element to its parent(s) in the other dimension.
Best regards,
Wim Gielis
IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Wim Gielis
IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly