Deleting elements without children
Posted: Tue Apr 08, 2014 10:21 am
Hi,
I'm trying to remove all consolidations elements without any children from dimension. This code below not working properly because deleting only some elements. What is wrong in this code below??
In this dimension I have multiple hierarchy.
Thanks for any suggestion.
sDimName = 'DestCustomer';
nX = 1;
nLimit = DIMSIZ(sDimName);
WHILE(nX<=nLimit);
sElementName = DIMNM(sDimName,nX);
sConElement = DTYPE(sDimName,sElementName);
sNumberOfChildren = ELCOMPN(sDimName,sElementName);
IF (sConElement @='C');
IF(sNumberOfChildren = 0);
DIMENSIONELEMENTDELETE(sDimName,sElementName);
ENDIF;
ENDIF;
nX = nX + 1;
END;
Regards
Rafal
I'm trying to remove all consolidations elements without any children from dimension. This code below not working properly because deleting only some elements. What is wrong in this code below??
In this dimension I have multiple hierarchy.
Thanks for any suggestion.
sDimName = 'DestCustomer';
nX = 1;
nLimit = DIMSIZ(sDimName);
WHILE(nX<=nLimit);
sElementName = DIMNM(sDimName,nX);
sConElement = DTYPE(sDimName,sElementName);
sNumberOfChildren = ELCOMPN(sDimName,sElementName);
IF (sConElement @='C');
IF(sNumberOfChildren = 0);
DIMENSIONELEMENTDELETE(sDimName,sElementName);
ENDIF;
ENDIF;
nX = nX + 1;
END;
Regards
Rafal