Question about DimensionElementInsertDirect

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

Question about DimensionElementInsertDirect

Post by lynnsong986 » Thu Oct 31, 2019 1:29 am

Hello, I came across this function DimensionElementInsertDirect in the pre-recorded training video (I did send the question to the trainer but I couldn’t wait for 24 hours)...

He put this function in Prolog where he basically said the reason why he used this one instead of the regular DimensionElement Insert in Metadata is because there were only two elements in the measure dimension and this saves compiling time.

my question is why he placed it in Prolog instead of Metadata? I read somewhere that the direct functions can be placed in any tab, is it true?

Thanks!

Wim Gielis
MVP
Posts: 2258
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1
Version: PAL 2.0.8
Excel Version: Office 365 - latest
Location: Brussels, Belgium
Contact:

Re: Question about DimensionElementInsertDirect

Post by Wim Gielis » Thu Oct 31, 2019 2:08 am

You can place them in any tab. But of course, if in Metadata / Data tab, then it must be part of the data source. In the other 2 tabs you’re not processing a data source so it can/should be without data source.

The fact that the dimension only has 2 elements is ridiculous as explanation for the Direct function. Usually you tend to use the Direct variants if the dimension has tens of thousands of elements or more and you only need to update the dimension with a very small number of changes.
Best regards,

Wim Gielis

Excel Most Valuable Professional, 2011-2014
http://www.wimgielis.com ==> 109 TM1 articles and a lot of custom code
Newest blog article: Set up a TM1 model with AutoHotKey as a service or application

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

Re: Question about DimensionElementInsertDirect

Post by lynnsong986 » Thu Oct 31, 2019 2:14 am

Thanks Wim! That’s exactly why I got so confused! I read the IBM documentation, which states the same as you just explained! I’ll see what he replies on this one...

User avatar
gtonkin
MVP
Posts: 735
Joined: Thu May 06, 2010 3:03 pm
OLAP Product: TM1
Version: PAL 2.0.3
Excel Version: 2016 64-bit
Location: JHB, South Africa
Contact:

Re: Question about DimensionElementInsertDirect

Post by gtonkin » Thu Oct 31, 2019 1:42 pm

It would not make much sense using DimensionElementInsertDirect in Metadata as DimensionElementInsert would do the same thing.
I did however do this inadvertently because I copied code from Data to Metadata and it crashed my server (10.2.2 FP4)

I have also found severe performance degradation using DimensionElementInsertDirect in Data when dealing with large dimensions and went back to a combination of Metadata and Data.

User avatar
jim wood
Site Admin
Posts: 3748
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: TM1 10.2.2
Excel Version: 2007
Location: 1639 Route 10, Suite 107, Parsippany, NJ, USA
Contact:

Re: Question about DimensionElementInsertDirect

Post by jim wood » Thu Oct 31, 2019 5:48 pm

gtonkin wrote:
Thu Oct 31, 2019 1:42 pm
It would not make much sense using DimensionElementInsertDirect in Metadata as DimensionElementInsert would do the same thing.
I did however do this inadvertently because I copied code from Data to Metadata and it crashed my server (10.2.2 FP4)

I have also found severe performance degradation using DimensionElementInsertDirect in Data when dealing with large dimensions and went back to a combination of Metadata and Data.
Correct me if I'm wrong but, this is also to do with commitment? Normal waits until the tab is changed but direct writes it straight to the dimension, the second being more beneficial it certain circumstances.
Struggling through the quagmire of life to reach the other side of who knows where.
Application Consulting Group (ACG) TM1 Consulting
OS: Windows 10 64-bit. TM1 Version: 10.2.2

User avatar
gtonkin
MVP
Posts: 735
Joined: Thu May 06, 2010 3:03 pm
OLAP Product: TM1
Version: PAL 2.0.3
Excel Version: 2016 64-bit
Location: JHB, South Africa
Contact:

Re: Question about DimensionElementInsertDirect

Post by gtonkin » Thu Oct 31, 2019 6:24 pm

jim wood wrote:
Thu Oct 31, 2019 5:48 pm
...
Correct me if I'm wrong but, this is also to do with commitment? Normal waits until the tab is changed but direct writes it straight to the dimension, the second being more beneficial it certain circumstances.
This link gives a bit more clarity on the workings.

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

Re: Question about DimensionElementInsertDirect

Post by lynnsong986 » Fri Nov 08, 2019 1:21 am

Thanks for the info, I don't think I'll use the direct method much at all knowing that I might crush the server!! my online trainer never got back to me on this question...I assume that he knew he didn't explain it correctly in the video haha!!

Wim Gielis
MVP
Posts: 2258
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1
Version: PAL 2.0.8
Excel Version: Office 365 - latest
Location: Brussels, Belgium
Contact:

Re: Question about DimensionElementInsertDirect

Post by Wim Gielis » Fri Nov 08, 2019 6:37 am

I also notice that using DimensionElementInsertDirect in the Prolog tab might mean that you need to run the process twice as the first time the new elements are not inserted.

Still I tend to use the function without any hesitation in the Data tab, I have never crashed the TM1 server with it. What hasn’t been discussed as an advantage of the Direct functions is that you don’t need to have many If’s and other logic twice, in Metadata and Data tab. In the end, good models are also focusing on maintenance of the model, and that is important too.
Best regards,

Wim Gielis

Excel Most Valuable Professional, 2011-2014
http://www.wimgielis.com ==> 109 TM1 articles and a lot of custom code
Newest blog article: Set up a TM1 model with AutoHotKey as a service or application

Post Reply