Using ELLEV on consolidation with nested consolidations
Posted: Wed Jan 28, 2015 8:37 pm
Hi all,
I'm trying to create a subset containing only level 0 elements from a consolidation in a TI process using the following code:
What I end up with is a subset with only a couple of elements which are the only N level elements one level down from the top level consolidation in it. All the other N level items that are further down a hierarchy of consolidations are missing.
What am I missing here? I expected the combination of ELLEV and ELCOMP to go through all items in the subset hierarchy tree, but it only seems to do one level? If that's just how it works how best would I get what I'm after?
I'm trying to create a subset containing only level 0 elements from a consolidation in a TI process using the following code:
Code: Select all
## Build branch subset ##
vString = 'Trading Branches';
Dim = 'Branch';
If (SubsetExists(Dim,vPrefix)=1);
SubsetDeleteAllElements(Dim,vPrefix);
Else;
SubsetCreate(Dim,vPrefix);
Endif;
vCounter =1;
vNumberOfComponents = ELCOMPN(Dim, vString);
WHILE (vCounter <= vNumberOfComponents);
IF (ELLEV (Dim, ELCOMP(Dim,vString, vCounter)) = 0);
SubsetElementInsert(Dim, vPrefix, ELCOMP(Dim,vString, vCounter),1);
ENDIF;
vCounter= vCounter +1;
END;
What am I missing here? I expected the combination of ELLEV and ELCOMP to go through all items in the subset hierarchy tree, but it only seems to do one level? If that's just how it works how best would I get what I'm after?