I was wondering if there is a way i could do this using a while loop?
Code: Select all
IF(vCatDir @= 'Filter by Category' % Scan ('*',vCatDIR) =1);
ITEMSKIP;
ENDIF;
sSub ='zzzCD-CAT'| vCatDIR;
#=====Create Subset For CATDIR ----> Cat====
smdx = '{FILTER({DESCENDANTS([Products].[' | vCatDir | '])},[Products].[Lvl] = "Cat")}';
IF ( SubsetExists ( 'Products' , sSub) = 1);
SubsetDestroy ('Products', sSub );
EndIF;
SUBSETCREATEBYMDX(sSub, smdx);
smdxProd = '{FILTER({DESCENDANTS([Products].[' | vCatDir | '])},[Products].[Lvl] = "ProdUse")}';
sSubset ='zzzCD-PU'| vCatDIR;
IF ( SubsetExists ( 'Products' , sSubset) = 1);
SubsetDestroy ('Products', sSubset );
EndIF;
SUBSETCREATEBYMDX(sSubset, smdxProd);