DIMENSIONELEMENTCOMPONENTADD - Not working as expected - Please advise
-
- Posts: 88
- Joined: Mon Oct 24, 2016 1:21 pm
- OLAP Product: TM1
- Version: TM1 Perspectives 10
- Excel Version: Excel 2016
DIMENSIONELEMENTCOMPONENTADD - Not working as expected - Please advise
Hi everyone,
Below is the sample syntax I am trying to add element to Parent called 'Total Entity'.
DIMENSIONELEMENTINSERT('dimName','', xle , 'N' );
DIMENSIONELEMENTCOMPONENTADD( 'dimName', 'Total Entity', xle, 1);
Someone time the result shows elements added under 'Total Entity' as child (which I want) but some time goes outside 'Total Entity' meaning does not get added as child. What could be the reason? What I'm I doing wrong?
Regards
Below is the sample syntax I am trying to add element to Parent called 'Total Entity'.
DIMENSIONELEMENTINSERT('dimName','', xle , 'N' );
DIMENSIONELEMENTCOMPONENTADD( 'dimName', 'Total Entity', xle, 1);
Someone time the result shows elements added under 'Total Entity' as child (which I want) but some time goes outside 'Total Entity' meaning does not get added as child. What could be the reason? What I'm I doing wrong?
Regards
- gtonkin
- MVP
- Posts: 1211
- Joined: Thu May 06, 2010 3:03 pm
- OLAP Product: TM1
- Version: Latest and greatest
- Excel Version: Office 365 64-bit
- Location: JHB, South Africa
- Contact:
Re: DIMENSIONELEMENTCOMPONENTADD - Not working as expected - Please advise
Check your dimension sort order. Try set to Hierarchy, by Name if not set already.
-
- Posts: 88
- Joined: Mon Oct 24, 2016 1:21 pm
- OLAP Product: TM1
- Version: TM1 Perspectives 10
- Excel Version: Excel 2016
Re: DIMENSIONELEMENTCOMPONENTADD - Not working as expected - Please advise
Not sure what that means. Do we set it from edit dimension structure? or via code? This is the code that will add elements going forward
- gtonkin
- MVP
- Posts: 1211
- Joined: Thu May 06, 2010 3:03 pm
- OLAP Product: TM1
- Version: Latest and greatest
- Excel Version: Office 365 64-bit
- Location: JHB, South Africa
- Contact:
Re: DIMENSIONELEMENTCOMPONENTADD - Not working as expected - Please advise
Right click your dimension, click Set Elements Order then Automatic and Hierarchy. You can use TI to set this too, to set to Hierarchy and name, but try the right-click method first.
-
- 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: DIMENSIONELEMENTCOMPONENTADD - Not working as expected - Please advise
It's in the }DimensionProperties cube but you can also set it via TI. Please consult the TI functions help.
-
- Posts: 88
- Joined: Mon Oct 24, 2016 1:21 pm
- OLAP Product: TM1
- Version: TM1 Perspectives 10
- Excel Version: Excel 2016
Re: DIMENSIONELEMENTCOMPONENTADD - Not working as expected - Please advise
Set to sort manually by Name.
Still same issue. example below, 903 and 904 are not rolling up to Total Entity.
is below code incorrect?
DIMENSIONELEMENTINSERT('dimName','', xle , 'N' );
DIMENSIONELEMENTCOMPONENTADD( 'dimName', 'Total Entity', xle, 1);
+Total Entity
--900
--901
--902
903
904
Still same issue. example below, 903 and 904 are not rolling up to Total Entity.
is below code incorrect?
DIMENSIONELEMENTINSERT('dimName','', xle , 'N' );
DIMENSIONELEMENTCOMPONENTADD( 'dimName', 'Total Entity', xle, 1);
+Total Entity
--900
--901
--902
903
904
- gtonkin
- MVP
- Posts: 1211
- Joined: Thu May 06, 2010 3:03 pm
- OLAP Product: TM1
- Version: Latest and greatest
- Excel Version: Office 365 64-bit
- Location: JHB, South Africa
- Contact:
Re: DIMENSIONELEMENTCOMPONENTADD - Not working as expected - Please advise
Currently set or was set? Did you change to automatic by hierarchy?
If you select element 903, can you roll it up to check what its parent is?
-
- Posts: 88
- Joined: Mon Oct 24, 2016 1:21 pm
- OLAP Product: TM1
- Version: TM1 Perspectives 10
- Excel Version: Excel 2016
Re: DIMENSIONELEMENTCOMPONENTADD - Not working as expected - Please advise
Initially it was not set to auto sort by Hierarchy. I have done that now.
Now after auto sort set, I deleted all elements and try adding again using code and it seems to be working. What was I doing wrong?
Also please clarify what does element weight parameter mean here in DIMENSIONELEMENTCOMPONENTADD
DIMENSIONELEMENTINSERT('dimName','', xle , 'N' );
DIMENSIONELEMENTCOMPONENTADD( 'dimName', 'Total Entity', xle, 1);
Now after auto sort set, I deleted all elements and try adding again using code and it seems to be working. What was I doing wrong?
Also please clarify what does element weight parameter mean here in DIMENSIONELEMENTCOMPONENTADD
DIMENSIONELEMENTINSERT('dimName','', xle , 'N' );
DIMENSIONELEMENTCOMPONENTADD( 'dimName', 'Total Entity', xle, 1);
- gtonkin
- MVP
- Posts: 1211
- Joined: Thu May 06, 2010 3:03 pm
- OLAP Product: TM1
- Version: Latest and greatest
- Excel Version: Office 365 64-bit
- Location: JHB, South Africa
- Contact:
Re: DIMENSIONELEMENTCOMPONENTADD - Not working as expected - Please advise
Generally when you create a hierarchy with levels, you would set sort order to Hierarchy so that it represents as a tree structure.
This however depends on your goal as you may choose manual and order elements as you want. No right answer here.
Would refer you to the manuals/online help with element weighting. But loosely, this is the multiplier used when aggregating child elements up the hierarchy.
This however depends on your goal as you may choose manual and order elements as you want. No right answer here.
Would refer you to the manuals/online help with element weighting. But loosely, this is the multiplier used when aggregating child elements up the hierarchy.
-
- Posts: 88
- Joined: Mon Oct 24, 2016 1:21 pm
- OLAP Product: TM1
- Version: TM1 Perspectives 10
- Excel Version: Excel 2016
Re: DIMENSIONELEMENTCOMPONENTADD - Not working as expected - Please advise
ok. Thanks for your help!
-
- Posts: 88
- Joined: Mon Oct 24, 2016 1:21 pm
- OLAP Product: TM1
- Version: TM1 Perspectives 10
- Excel Version: Excel 2016
Re: DIMENSIONELEMENTCOMPONENTADD - Not working as expected - Please advise
Do I need to execute this code from MetaData tab or Prolog itself is fine?
-
- MVP
- Posts: 3128
- 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: DIMENSIONELEMENTCOMPONENTADD - Not working as expected - Please advise
If you have a data source, like a relational table or flat file, then probably in the Metadata tab.
If it's elements that you insert as a one-off and not through a data source, it would go in the Prolog tab.
If it's elements that you insert as a one-off and not through a data source, it would go in the Prolog tab.
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
-
- 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: DIMENSIONELEMENTCOMPONENTADD - Not working as expected - Please advise
You didn't do anything "wrong", it's just that the information you were giving us was "fake news". Sorry, couldn't help it. Those DIMENSIONSORT functions have absolutely NOTHING to do with how children roll up to a parent. All they control is the order of how the elements appear in a dimension. Absent a default subset, if you double-click on a dimension and open the subset editor you are going to see the elements in the order they appear in a dimension, sometimes with consolidated nodes mixed in with leaf nodes. It appears that some leaves may not appear to be a children of their parents based on this listing. However, if you were to expand the parents you would see that they are there. This was likely the case. I have never, ever seen a case where a proper use of DIMENSIONELEMENTCOMPONENTADD did not add a child to a parent and your syntax looked correct.
-
- Community Contributor
- Posts: 292
- Joined: Tue Sep 06, 2016 7:55 am
- OLAP Product: TM1
- Version: 10.1.1
- Excel Version: Excel 2010
Re: DIMENSIONELEMENTCOMPONENTADD - Not working as expected - Please advise
This seems slightly harsh given fake news is the deliberate attempt to fool the gullible/stupid.it's just that the information you were giving us was "fake news"
-
- 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: DIMENSIONELEMENTCOMPONENTADD - Not working as expected - Please advise
You do realize it was humor, right?
-
- Community Contributor
- Posts: 292
- Joined: Tue Sep 06, 2016 7:55 am
- OLAP Product: TM1
- Version: 10.1.1
- Excel Version: Excel 2010
Re: DIMENSIONELEMENTCOMPONENTADD - Not working as expected - Please advise
I obviously should have added a smiley after my comment!You do realize it was humor, right?
-
- Posts: 88
- Joined: Mon Oct 24, 2016 1:21 pm
- OLAP Product: TM1
- Version: TM1 Perspectives 10
- Excel Version: Excel 2016