build new dimension using subset of a dimension using TI pro
-
- Posts: 8
- Joined: Wed Apr 14, 2010 10:45 pm
- OLAP Product: tm1
- Version: 9.4
- Excel Version: 2003
build new dimension using subset of a dimension using TI pro
Hi,
I'm building the dimension,using existing dimension model,where the existing dimension has the different costcentres for ex.hr,IT,Fin under each costcentre we have different levels.i want to build the different individual dimensions like HR,FIN,IT dimensions using existing dimension model as input in TI Process.
i'm trying to acheive this by creating a subset with level0 elements and try to build the different dimensions by using the ELPAR functions in metadata tab.But i'm not able to build the dimension with complete hierarchy.
It is on high priority to build the dimension.
can any on please guide/help me how to build this..
Thanks in advance for your assistance.
regards,
Sunitha.
I'm building the dimension,using existing dimension model,where the existing dimension has the different costcentres for ex.hr,IT,Fin under each costcentre we have different levels.i want to build the different individual dimensions like HR,FIN,IT dimensions using existing dimension model as input in TI Process.
i'm trying to acheive this by creating a subset with level0 elements and try to build the different dimensions by using the ELPAR functions in metadata tab.But i'm not able to build the dimension with complete hierarchy.
It is on high priority to build the dimension.
can any on please guide/help me how to build this..
Thanks in advance for your assistance.
regards,
Sunitha.
-
- Posts: 8
- Joined: Wed Apr 14, 2010 10:45 pm
- OLAP Product: tm1
- Version: 9.4
- Excel Version: 2003
building new dimension using subse of dim in TI processes
Hi,
I'm building the dimension,using existing dimension model,where the existing dimension has the different costcentres for ex.hr,IT,Fin under each costcentre we have different levels.i want to build the different individual dimensions using the existing dimension modelm as input.
i tried using subset and elpar functions but i'm not able to build it.
can you please guide me how to build this..
Thanks in advance for your assistance..
regards,
Sunitha.
{Admin Note: This topic has been merged into an almost identical one by the same poster. Please keep one topic to one thread. Thanks.}
I'm building the dimension,using existing dimension model,where the existing dimension has the different costcentres for ex.hr,IT,Fin under each costcentre we have different levels.i want to build the different individual dimensions using the existing dimension modelm as input.
i tried using subset and elpar functions but i'm not able to build it.
can you please guide me how to build this..
Thanks in advance for your assistance..
regards,
Sunitha.
{Admin Note: This topic has been merged into an almost identical one by the same poster. Please keep one topic to one thread. Thanks.}
-
- MVP
- Posts: 3230
- Joined: Mon Dec 29, 2008 6:26 pm
- OLAP Product: TM1, Jedox
- Version: PAL 2.1.5
- Excel Version: Microsoft 365
- Location: Brussels, Belgium
- Contact:
Re: build new dimension using subset of a dimension using TI
Hello,
What is the logic to choose the elements HR, FIN, IT, ...
- do they contain an attribute?
- is it always level 4 or 3 or any other number (but always the same)?
- or these the direct children of some other consolidation?
- are these all elements in the dimension with parents?
- ...
Without a clear definition of these items, you're process will not work.
Wim
What is the logic to choose the elements HR, FIN, IT, ...
- do they contain an attribute?
- is it always level 4 or 3 or any other number (but always the same)?
- or these the direct children of some other consolidation?
- are these all elements in the dimension with parents?
- ...
Without a clear definition of these items, you're process will not work.
Wim
Best regards,
Wim Gielis
IBM Champion 2024-2025
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-2025
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
-
- Posts: 8
- Joined: Wed Apr 14, 2010 10:45 pm
- OLAP Product: tm1
- Version: 9.4
- Excel Version: 2003
Re: build new dimension using subset of a dimension using TI
Hi Wim,
there are no attributes in the base dimension.
we have level 4 hirearchy in the base dimension
each department in the dimension has its direct children with level3 hierarchy.
for reference i'm attaching snap shot of the base dim with different depts.what we need to do was, we need to build individual dimensions like hr,fin etc with the help os base dim
regards,
sunitha
there are no attributes in the base dimension.
we have level 4 hirearchy in the base dimension
each department in the dimension has its direct children with level3 hierarchy.
for reference i'm attaching snap shot of the base dim with different depts.what we need to do was, we need to build individual dimensions like hr,fin etc with the help os base dim
regards,
sunitha
- Attachments
-
- base dim.doc
- (121 KiB) Downloaded 604 times
-
- Posts: 8
- Joined: Wed Apr 14, 2010 10:45 pm
- OLAP Product: tm1
- Version: 9.4
- Excel Version: 2003
Re: build new dimension using subset of a dimension using TI
attached doc is the sample base dimension which has three departments HR, Fin, Trans.It has its own children, without any attributes. Now the requirement is we need to build the individual dimensions like HR, FIN, Trans as different dimensions by using the base dimension with TI processes.
Can any one help me how to build this?
Can any one help me how to build this?
- Attachments
-
- base dim.doc
- (85 KiB) Downloaded 653 times
-
- MVP
- Posts: 3230
- Joined: Mon Dec 29, 2008 6:26 pm
- OLAP Product: TM1, Jedox
- Version: PAL 2.1.5
- Excel Version: Microsoft 365
- Location: Brussels, Belgium
- Contact:
Re: build new dimension using subset of a dimension using TI
Hello
Here's fully developed TI code. Copy paste the code into the Advanced > Prolog tab of a TI process, use 'None' as the Data source.
That should do it.
Use variables to reduce the amount of hardcoded names.
Wim
Here's fully developed TI code. Copy paste the code into the Advanced > Prolog tab of a TI process, use 'None' as the Data source.
Code: Select all
# Wim Gielis
# http://www.wimgielis.be
# create the dimension
i=1;
WHILE(i<=ELCOMPN('ecc_planningprocess','totalunits'));
vComp=ELCOMP('ecc_planningprocess','totalunits',i);
IF(DIMENSIONEXISTS(vComp)=1);
DIMENSIONDELETEALLELEMENTS(vComp);
ELSE;
DIMENSIONCREATE(vComp);
ENDIF;
SUBSETDESTROY('ecc_planningprocess','mysubset');
SUBSETCREATEBYMDX('mysubset', ' {TM1FILTERBYLEVEL({DESCENDANTS(ecc_planningprocess.[' | vComp | ']) }, 0)}' );
# loop through the elements of the subset
j=1;
WHILE(j<=SUBSETGETSIZE('ecc_planningprocess','mysubset'));
vElem=SUBSETGETELEMENTNAME('ecc_planningprocess','mysubset',j);
vType=DTYPE('ecc_planningprocess',vElem);
DIMENSIONELEMENTINSERT(vComp,'',vElem,vType);
# PARENTS (loop through them)
k=1;
WHILE(k<=ELPARN('ecc_planningprocess',vElem));
vParent=ELPAR('ecc_planningprocess',vElem,k);
IF(vParent@<>vComp);
vWeight=ELWEIGHT('ecc_planningprocess',vParent,vElem);
DIMENSIONELEMENTINSERT(vComp,'',vParent,'C');
DIMENSIONELEMENTCOMPONENTADD(vComp,vParent,vElem,vWeight);
k=k+1;
ENDIF;
END;
j=j+1;
END;
i=i+1;
END;
SUBSETDESTROY('ecc_planningprocess','mysubset');
Use variables to reduce the amount of hardcoded names.
Wim
Best regards,
Wim Gielis
IBM Champion 2024-2025
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-2025
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
-
- Posts: 8
- Joined: Wed Apr 14, 2010 10:45 pm
- OLAP Product: tm1
- Version: 9.4
- Excel Version: 2003
Re: build new dimension using subset of a dimension using TI
Thank you wim
for your interest it helped me in creating the dimensions.
for your interest it helped me in creating the dimensions.
-
- Posts: 28
- Joined: Wed Sep 01, 2010 2:15 pm
- OLAP Product: TM1
- Version: 9.5.1
- Excel Version: 2007
Re: build new dimension using subset of a dimension using TI
Thanks Wim. I am able to use your code to do a similar task today. Thanks for the code. Thanks Sunitha 

-
- Posts: 5
- Joined: Thu Mar 28, 2013 8:46 am
- OLAP Product: TM1
- Version: 10.1
- Excel Version: 2010
Re: build new dimension using subset of a dimension using TI
Great example, it helped me a lot.
-
- Regular Participant
- Posts: 424
- Joined: Sat Mar 10, 2012 1:03 pm
- OLAP Product: IBM TM1, Planning Analytics, P
- Version: PAW 2.0.8
- Excel Version: 2019
Re: build new dimension using subset of a dimension using TI
Hi All,I have created dimension 'ecc_planningprocess' and tried below Wim Gielis code:
But when I run the process in TM1 perspectives,It doesn't show any error but the process doesn't initialize and keep running on and hangs up.Any ideas please.Thanks
Code: Select all
# Wim Gielis
# http://www.wimgielis.be
# create the dimension
i=1;
WHILE(i<=ELCOMPN('ecc_planningprocess','totalunits'));
vComp=ELCOMP('ecc_planningprocess','totalunits',i);
IF(DIMENSIONEXISTS(vComp)=1);
DIMENSIONDELETEALLELEMENTS(vComp);
ELSE;
DIMENSIONCREATE(vComp);
ENDIF;
SUBSETDESTROY('ecc_planningprocess','mysubset');
SUBSETCREATEBYMDX('mysubset', ' {TM1FILTERBYLEVEL({DESCENDANTS(ecc_planningprocess.[' | vComp | ']) }, 0)}' );
# loop through the elements of the subset
j=1;
WHILE(j<=SUBSETGETSIZE('ecc_planningprocess','mysubset'));
vElem=SUBSETGETELEMENTNAME('ecc_planningprocess','mysubset',j);
vType=DTYPE('ecc_planningprocess',vElem);
DIMENSIONELEMENTINSERT(vComp,'',vElem,vType);
# PARENTS (loop through them)
k=1;
WHILE(k<=ELPARN('ecc_planningprocess',vElem));
vParent=ELPAR('ecc_planningprocess',vElem,k);
IF(vParent@<>vComp);
vWeight=ELWEIGHT('ecc_planningprocess',vParent,vElem);
DIMENSIONELEMENTINSERT(vComp,'',vParent,'C');
DIMENSIONELEMENTCOMPONENTADD(vComp,vParent,vElem,vWeight);
k=k+1;
ENDIF;
END;
j=j+1;
END;
i=i+1;
END;
SUBSETDESTROY('ecc_planningprocess','mysubset');
"You Never Fail Until You Stop Trying......"
-
- Regular Participant
- Posts: 424
- Joined: Sat Mar 10, 2012 1:03 pm
- OLAP Product: IBM TM1, Planning Analytics, P
- Version: PAW 2.0.8
- Excel Version: 2019
Re: build new dimension using subset of a dimension using TI
Hi Wim,I have tried again ,It is giving me error dimension ecc_planningprocess could not be find ,when I commented out
the process runs successfully but I do not see any 'ecc_planningprocess' dimension being created.Please help me on this.Thanks
Code: Select all
SUBSETDESTROY('ecc_planningprocess','mysubset');
"You Never Fail Until You Stop Trying......"
-
- MVP
- Posts: 1828
- Joined: Mon Dec 05, 2011 11:51 am
- OLAP Product: Cognos TM1
- Version: PA2.0 and most of the old ones
- Excel Version: All of em
- Location: Manchester, United Kingdom
- Contact:
Re: build new dimension using subset of a dimension using TI
BariAbdul,
Please post the entire contents of your TI.
Please post the entire contents of your TI.
Declan Rodger
-
- Regular Participant
- Posts: 424
- Joined: Sat Mar 10, 2012 1:03 pm
- OLAP Product: IBM TM1, Planning Analytics, P
- Version: PAW 2.0.8
- Excel Version: 2019
Re: build new dimension using subset of a dimension using TI
Thanks a lot declanr,The entire Code is below, as Wim suggested I have choose none as the data source and pasted whole content below
Code: Select all
# Wim Gielis
# http://www.wimgielis.be
# create the dimension
i=1;
WHILE(i<=ELCOMPN('ecc_planningprocess','totalunits'));
vComp=ELCOMP('ecc_planningprocess','totalunits',i);
IF(DIMENSIONEXISTS(vComp)=1);
DIMENSIONDELETEALLELEMENTS(vComp);
ELSE;
DIMENSIONCREATE(vComp);
ENDIF;
SUBSETDESTROY('ecc_planningprocess','mysubset');
SUBSETCREATEBYMDX('mysubset', ' {TM1FILTERBYLEVEL({DESCENDANTS(ecc_planningprocess.[' | vComp | ']) }, 0)}' );
# loop through the elements of the subset
j=1;
WHILE(j<=SUBSETGETSIZE('ecc_planningprocess','mysubset'));
vElem=SUBSETGETELEMENTNAME('ecc_planningprocess','mysubset',j);
vType=DTYPE('ecc_planningprocess',vElem);
DIMENSIONELEMENTINSERT(vComp,'',vElem,vType);
# PARENTS (loop through them)
k=1;
WHILE(k<=ELPARN('ecc_planningprocess',vElem));
vParent=ELPAR('ecc_planningprocess',vElem,k);
IF(vParent@<>vComp);
vWeight=ELWEIGHT('ecc_planningprocess',vParent,vElem);
DIMENSIONELEMENTINSERT(vComp,'',vParent,'C');
DIMENSIONELEMENTCOMPONENTADD(vComp,vParent,vElem,vWeight);
k=k+1;
ENDIF;
END;
j=j+1;
END;
i=i+1;
END;
SUBSETDESTROY('ecc_planningprocess','mysubset');
"You Never Fail Until You Stop Trying......"
-
- MVP
- Posts: 1828
- Joined: Mon Dec 05, 2011 11:51 am
- OLAP Product: Cognos TM1
- Version: PA2.0 and most of the old ones
- Excel Version: All of em
- Location: Manchester, United Kingdom
- Contact:
Re: build new dimension using subset of a dimension using TI
You say that you see no "ecc_planningprocess" dimension being created but the first thing your TI tries to do is read what is already in that dimension. If it doesn't exist when you start it won't do a great deal.
Perhaps I am missing something but lets go back to basics, what are you trying to do? What already exists and what are you trying to create from it?
Perhaps I am missing something but lets go back to basics, what are you trying to do? What already exists and what are you trying to create from it?
Declan Rodger
-
- Regular Participant
- Posts: 424
- Joined: Sat Mar 10, 2012 1:03 pm
- OLAP Product: IBM TM1, Planning Analytics, P
- Version: PAW 2.0.8
- Excel Version: 2019
Re: build new dimension using subset of a dimension using TI
Thanks a lot Declanr,Actually I am trying to create dimension similar to OP sunitha has posted.When I find 'No Dimension Found Error',I did create empty dimension using DimensionCreate(ecc_planningprocess) but nothing being created.Now I would create dimension similar to attachement the OP posted and see whether it would worked out.Appreciate your help.
"You Never Fail Until You Stop Trying......"
-
- MVP
- Posts: 1828
- Joined: Mon Dec 05, 2011 11:51 am
- OLAP Product: Cognos TM1
- Version: PA2.0 and most of the old ones
- Excel Version: All of em
- Location: Manchester, United Kingdom
- Contact:
Re: build new dimension using subset of a dimension using TI
The code you are using has its first step of looping an elements children... if that element doesn't exist nothing in the loop will be done.
Declan Rodger