Prefix to Consolidation Element
Posted: Wed Jan 18, 2012 3:38 am
I want to add prefix to a consolidation element after copying all the consolidation to a new dimension.
If I have a consolidation, Total, I want to add ''2011-'' along with the Total consolidation.
Given is the logic that I am adding consolidation and its N level elements:
sElType = DType( pSourceDim, vElement );
DimensionElementInsert( pTargetDim, '', vElement, sElType );
IF( sElType @= 'C' & ElCompN( pSourceDim, vElement ) > 0 );
nChildren = ElCompN( pSourceDim, vElement );
nCount = 1;
While( nCount <= nChildren );
sChildElement = ElComp( pSourceDim, vElement, nCount );
sChildType = DType( pSourceDim, sChildElement );
sChildWeight = ElWeight( pSourceDim, vElement, sChildElement );
DimensionElementInsert( pTargetDim, '', sChildElement, sChildType );
DimensionElementComponentAdd( pTargetDim, vElement, sChildElement, sChildWeight );
nCount = nCount + 1;
End;
EndIf;
EndIf;
Any Idea!!
Thanks in advance.
Pradeep J
If I have a consolidation, Total, I want to add ''2011-'' along with the Total consolidation.
Given is the logic that I am adding consolidation and its N level elements:
sElType = DType( pSourceDim, vElement );
DimensionElementInsert( pTargetDim, '', vElement, sElType );
IF( sElType @= 'C' & ElCompN( pSourceDim, vElement ) > 0 );
nChildren = ElCompN( pSourceDim, vElement );
nCount = 1;
While( nCount <= nChildren );
sChildElement = ElComp( pSourceDim, vElement, nCount );
sChildType = DType( pSourceDim, sChildElement );
sChildWeight = ElWeight( pSourceDim, vElement, sChildElement );
DimensionElementInsert( pTargetDim, '', sChildElement, sChildType );
DimensionElementComponentAdd( pTargetDim, vElement, sChildElement, sChildWeight );
nCount = nCount + 1;
End;
EndIf;
EndIf;
Any Idea!!
Thanks in advance.
Pradeep J