Page 1 of 1
Question about DimensionElementInsertDirect
Posted: Thu Oct 31, 2019 1:29 am
by lynnsong986
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!
Re: Question about DimensionElementInsertDirect
Posted: Thu Oct 31, 2019 2:08 am
by Wim Gielis
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.
Re: Question about DimensionElementInsertDirect
Posted: Thu Oct 31, 2019 2:14 am
by lynnsong986
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...
Re: Question about DimensionElementInsertDirect
Posted: Thu Oct 31, 2019 1:42 pm
by gtonkin
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.
Re: Question about DimensionElementInsertDirect
Posted: Thu Oct 31, 2019 5:48 pm
by jim wood
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.
Re: Question about DimensionElementInsertDirect
Posted: Thu Oct 31, 2019 6:24 pm
by gtonkin
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.
Re: Question about DimensionElementInsertDirect
Posted: Fri Nov 08, 2019 1:21 am
by lynnsong986
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!!
Re: Question about DimensionElementInsertDirect
Posted: Fri Nov 08, 2019 6:37 am
by Wim Gielis
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.