Help with bedrock's dim.clone.fromsubset

Post Reply
kaazimraza
Posts: 95
Joined: Mon Jun 25, 2012 6:58 am
OLAP Product: TM1, SSAS, Power BI
Version: 10.2.2
Excel Version: 2016

Help with bedrock's dim.clone.fromsubset

Post by kaazimraza »

Hi all,

I have a scenario where I have to unite two dims into one. so I decided not to reinvent the wheel and bank on the existing dim cloning process from Bedrock. I tweaked it a little, by commenting out the call to dim.hierarchy.unwind.all in the 'Prolog' part, as I am cleaning out the dim structure entirely in the Parent process which is calling this Bedrock process. However; after the modifications, it is leaving out some of the children elements, i.e. it does not add all children elements for all C level, for instance, if source dimension has a C level element Expense Accounts having 1,2,3,4,5 elements, it is adding element 1 4 to 5 times in the target element under Expense Accounts.

In the 'Metadata' tab, i changed the bit where it is adding the element, from

Code: Select all

  

## Add the element to the target dimension.
 DimensionElementInsert( pTargetDim, '', vElement, 'N' );
To

Code: Select all

DimensionElementComponentAdd( pTargetDim, pConsolElement, vElement, 1 );
Would appreciate if someone can help me through this one.

[Edit]
I am using TM1 9.5.2 with Windows 7 and Excel 2010 (clients).
Thanks,

Kaz
kaazimraza
Posts: 95
Joined: Mon Jun 25, 2012 6:58 am
OLAP Product: TM1, SSAS, Power BI
Version: 10.2.2
Excel Version: 2016

Re: Help with bedrock's dim.clone.fromsubset

Post by kaazimraza »

Um...guys, no one?
Thanks,

Kaz
Alan Kirk
Site Admin
Posts: 6667
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: Help with bedrock's dim.clone.fromsubset

Post by Alan Kirk »

kaazimraza wrote:Um...guys, no one?
Can't say that I'm a huge Bedrock fan so I really don't know that code off by heart, but more to the point I'm reluctant to assume that we would be singing from the same sheet (i.e. version) of the code even if I did.

If you put the full code up (or better still, the .pro file) I'm quite happy to take a look at it when I have a moment (and I can't guarantee that that would be immediately) but I wouldn't like to make assumptions that your subtractions and additions would be the same as what I might see if I were to try the same thing.
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
User avatar
Martin Ryan
Site Admin
Posts: 2003
Joined: Sat May 10, 2008 9:08 am
OLAP Product: TM1
Version: 10.1
Excel Version: 2010
Location: Wellington, New Zealand
Contact:

Re: Help with bedrock's dim.clone.fromsubset

Post by Martin Ryan »

Ditto to the request for the full code but from your description of the problem I would hazard a guess that you have a counter that isn't incrementing correctly, or perhaps you're using the wrong counter in the wrong place.
Please do not send technical questions via private message or email. Post them in the forum where you'll probably get a faster reply, and everyone can benefit from the answers.
Jodi Ryan Family Lawyer
kaazimraza
Posts: 95
Joined: Mon Jun 25, 2012 6:58 am
OLAP Product: TM1, SSAS, Power BI
Version: 10.2.2
Excel Version: 2016

Re: Help with bedrock's dim.clone.fromsubset

Post by kaazimraza »

Hi all,

Thanks for your replies. I have been able to crack it. There were two things that I corrected. One the source subset, where not all elements were expanded. Secondly, I sorted the dimension on hierarchy. these two things gave me the result I was looking for.

Apologies for late reply.
Thanks,

Kaz
Post Reply