Below is the code for process that give you the ability to create a subset based on the children of a consolidation. You can limit the subset to x number of levels below the parent and you can also ignore the parent. Due to the way it is built you can stack multiple versions within the same subset:
Code: Select all
### Parameters
pSubset: string
pDim: string
pParentElem: string
pElem: string
pLvl: number
pLimit: number
pIgnore: string
#Always pass pSubset, pDim, pParentElem (send blank), pElem and pLvl
#Optional: pLimit and pIgnore
### Prolog
# Written by Jim Wood
# 10/11/2012
i=ELCOMPN(pDim, pElem);
WHILE(i>0);
IF((pLimit=0) % (pLimit>pLvl));
ExecuteProcess(
'RAD_SUBSET_create_recursively_lvl_limit',
'pSubset', pSubset,
'pDim', pDim,
'pParentElem', pElem,
'pElem', ELCOMP(pDim,pElem,i),
'pLvl', pLvl+1,
'pLimit', pLimit,
'pIgnore',''
);
EndIF;
i=i-1;
END;
IF(pElem@<>pIgnore);
SubSetElementInsert(pDim,pSubset,pElem,1);
EndIF;
I hope it proves useful,
Jim.