Page 1 of 1

Adding N-Level Elements to Considation Fails

Posted: Thu Sep 06, 2012 7:03 pm
by CiskoWalt
Hello,

I have a file that has the following 2 columns of data: MSO Code, Contract Code

I am trying to create the following 2 hierarchies within a dim using TI.


All MSO (consolidation)
MSO Code (consolidation)
MSO Code-Contract Code (the n-level)

All by Party (consolidation)
Contract code (consolidation)
MSO Code-Contract code (the n-level)

I am unable to add the n-level elements (the concatenation of the 2 codes) to the second level (MSO Code and Contract Code)of both hierarchies.

PROLOG (Works)

dimRef='Affiliate Code';
sAllByParty = 'All by Party';
sAllMSOs = 'All MSOs';
sTotalExclOtherMSO = 'Total Excl Other MSOs';

# Dimension ElementInsert. Function Adds an element to a dimension
DimensionElementInsert(dimRef,'',sAllByParty,'c');

# Dimension ElementInsert. Function Adds an element to a dimension
DimensionElementInsert(dimRef,'',sAllMSOs,'c');

# Function adds a component (child) to a consolidated element.
DimensionElementComponentAdd (dimRef, sAllMSOs, sTotalExclOtherMSO, 1);


META DATA( works)

Meta data tab:

1) adds the MSO Id to the Total Excl Other MSOs parent
2) add the Contract Id to the All by Party parent
3) adds the Concatenation of MSO Id and Contract Id as an n-level element.

sMsoCode = TRIM (vMSO_Code);
sCPCode = TRIM(vCP_ALTID);
sMsoCPCode = sMsoCode | '-' | sCPCode;

IF (sMsoCode @= '');
ITEMSKIP;
ENDIF;


#^^ Add Alt ID to 'All by Party' Hierarchy

#^^ Add the Contract Party Code to the 'All by Party' consolidation
DimensionElementComponentAdd(dimRef, sAllByParty, sCPCode,1);

#^^ Add MSO Id to 'All MSOs' Hierarchy

#^^ Add the MSO Code to the 'Total Excl Other MSOs' consolidation
DimensionElementComponentAdd(dimRef, sTotalExclOtherMSO, sMsoCode,1);

#^^ Add the MSO Code and CP Code as N-level elements
DimensionElementInsert(dimRef,'',sMsoCPCode ,'n');

DATA tab (does not Work)

The data tab is supposed to add the n-level elements (sMsoCPCode) to the parent elements (sMsoCode and sCPCode) created in the META DATA tab.

sMsoCode = TRIM (vMSO_Code);
sCPCode = TRIM(vCP_ALTID);
sMsoCPCode = sMsoCode | '-' | sCPCode;

#^^ Add N-level child elements to the 2 Hierarchies

#^^ Add the Concatenation of MSO Code and Contract Party to the MSO Code hierarchy
DimensionElementComponentAdd (dimRef, sMSOCode, sMsoCPCode, 1);

#^^ Add N-level child to 'All MSOs' hierarchy's MSO Code Consolidated Element

#^^ Add the Concatenation of MSO Code and Contract Party to
DimensionElementComponentAdd (dimRef, sCPCode, sMsoCPCode, 1);


Thanks,

Walt

Re: Adding N-Level Elements to Considation Fails

Posted: Thu Sep 06, 2012 7:22 pm
by declanr
DimensionElementComponentAdd() is a metadata function and as such you should process it in the metadata tab.

HTH

Re: Adding N-Level Elements to Considation Fails

Posted: Thu Sep 06, 2012 7:34 pm
by qml
declanr wrote:DimensionElementComponentAdd() is a metadata function and as such you should process it in the metadata tab.
I beg to differ. There is no commandment not to use this function on other tabs (bar the Data tab).

That however does not take from the fact that the OP's code should all be put on the Metadata tab, I see absolutely no reason to split it like that.

Re: Adding N-Level Elements to Considation Fails

Posted: Thu Sep 06, 2012 8:01 pm
by tomok
qml wrote:
declanr wrote:DimensionElementComponentAdd() is a metadata function and as such you should process it in the metadata tab.
I beg to differ. There is no commandment not to use this function on other tabs (bar the Data tab).

That however does not take from the fact that the OP's code should all be put on the Metadata tab, I see absolutely no reason to split it like that.
There is no commandment to not put the DimensionElementComponentAdd in the Data tab, it just won't work and it's the direct reason his TI process is not working.

Re: Adding N-Level Elements to Considation Fails

Posted: Thu Sep 06, 2012 8:03 pm
by declanr
qml wrote:
declanr wrote:DimensionElementComponentAdd() is a metadata function and as such you should process it in the metadata tab.
I beg to differ. There is no commandment not to use this function on other tabs (bar the Data tab).

That however does not take from the fact that the OP's code should all be put on the Metadata tab, I see absolutely no reason to split it like that.
Very true of course, I was however basing it on the OP's code and should have clarified I was referring to the code that was on the data tab only, which should instead have been in the metadata.