Page 1 of 1

Getting First children of a member

Posted: Fri Jan 18, 2019 9:35 pm
by manu0521
Hi ,

I have a source as sql table where I have around 1 million rows with budget values. Unfortunately the data is not at lower level for material dimension. Its one level higher . SO while loading I have to get the first children of the product code and then load it . Budget doesnt chnage much over time ,so may be this load is 2 or 3 times max .

What function should I use to get the first children of an element .

Thanks,

Re: Getting First children of a member

Posted: Fri Jan 18, 2019 10:24 pm
by paulsimon
ELCOMP - just look at the Reference Guide

Re: Getting First children of a member

Posted: Sat Jan 19, 2019 1:05 pm
by Wim Gielis
Indeed, ELCOMP is the one you need.

Could it be that the first child is again a consolidated element in the Product dimension ?
Then maybe it might be an idea to store the target level 0 element as a Text attribute on the consolidated Product element where the budget data arrive. Update the attribute during the reload of the Product dimension, or in a separate process before you kick off the import of budget data.

Re: Getting First children of a member

Posted: Mon Jan 21, 2019 1:55 pm
by manu0521
Thanks ! Just noticed it was not one level up it was two levels up .

So its like 10, 10-1, 10-1-100, Material1

so the table has 10-1 and there can be many children under 10-1 like 10-1-100 ,10-1-101

But its okay to get first childrens children .

Do I do ELMCOMP 2 times

Elcomp('Item',ELCOMP('item','10-1',1) ,1)

IS there any straight forward formula .

Thanks

Re: Getting First children of a member

Posted: Mon Jan 21, 2019 2:37 pm
by Wim Gielis
If it's the first child of the first child, you have to do it like that. It's fine.
Making sure that indeed, the first child is a consolidated element, and also that the first child of the first child is a level 0 element.