Problem with delete subset
Posted: Tue Oct 08, 2013 2:42 pm
Have difficult with delete a Subset from all Cube dimensions have only param name cube and name subset.
Can anyone help?
Can anyone help?
Discussing all things TM1, Planning Analytics, PAx and PAW
https://www.tm1forum.com/
I'd love to, but I have no idea what you are asking for, so please spend the time needed to explain it properly and clearly.G.Frimen wrote:Can anyone help?
If Kamil's clairvoyant skills are spot on then this will do it.qml wrote:If you mean that knowing the cube name you want to find all the dimensions in that cube and then delete all subsets for these dimensions with a specific name, then you want to use a combination of TABDIM function in a WHILE loop to figure out the subsequent dimensions with SubsetExists and SubsetDestroy.
Code: Select all
IF( ViewExists( cCub, sZeroView ) = 1 );
ViewDestroy( cCub, sZeroView );
EndIF;
nDim = 1;
While( TabDim( cCub, nDim ) @<> '' );
sDim = TabDim( cCub, nDim );
IF( SubsetExists( sDim, sZeroSub ) = 1 );
SubsetDestroy( sDim, sZeroSub );
EndIF;
nDim = nDim + 1;
End;
THANKS!!! greatly work, that process that I'm looking!lotsaram wrote:If Kamil's clairvoyant skills are spot on then this will do it.qml wrote:If you mean that knowing the cube name you want to find all the dimensions in that cube and then delete all subsets for these dimensions with a specific name, then you want to use a combination of TABDIM function in a WHILE loop to figure out the subsequent dimensions with SubsetExists and SubsetDestroy.But really I have no idea what your question says. If Kamil hadn't made what looks to be a good guess from your question I and probably others would have been less polite in directing you to pay more attention to framing a sensible question - otherwise how can you realistically expect to get help. It behooves the person asking for assistance to to the groundwork, not leave others to do it!Code: Select all
IF( ViewExists( cCub, sZeroView ) = 1 ); ViewDestroy( cCub, sZeroView ); EndIF; nDim = 1; While( TabDim( cCub, nDim ) @<> '' ); sDim = TabDim( cCub, nDim ); IF( SubsetExists( sDim, sZeroSub ) = 1 ); SubsetDestroy( sDim, sZeroSub ); EndIF; nDim = nDim + 1; End;