Problem with delete subset

Post Reply
User avatar
G.Frimen
Posts: 18
Joined: Wed Jun 05, 2013 2:31 pm
OLAP Product: IBM Cognos TM1
Version: 10.1.1
Excel Version: 2007
Location: Ukraine
Contact:

Problem with delete subset

Post by G.Frimen »

Have difficult with delete a Subset from all Cube dimensions have only param name cube and name subset.
Can anyone help?
User avatar
qml
MVP
Posts: 1098
Joined: Mon Feb 01, 2010 1:01 pm
OLAP Product: TM1 / Planning Analytics
Version: 2.0.9 and all previous
Excel Version: 2007 - 2016
Location: London, UK, Europe

Re: Problem with delete subset

Post by qml »

G.Frimen wrote:Can anyone help?
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.

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.
Kamil Arendt
lotsaram
MVP
Posts: 3706
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: Problem with delete subset

Post by lotsaram »

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.
If Kamil's clairvoyant skills are spot on then this will 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;
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!
User avatar
G.Frimen
Posts: 18
Joined: Wed Jun 05, 2013 2:31 pm
OLAP Product: IBM Cognos TM1
Version: 10.1.1
Excel Version: 2007
Location: Ukraine
Contact:

Re: Problem with delete subset

Post by G.Frimen »

lotsaram wrote:
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.
If Kamil's clairvoyant skills are spot on then this will 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;
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!
THANKS!!! greatly work, that process that I'm looking!
Wim Gielis
MVP
Posts: 3241
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Problem with delete subset

Post by Wim Gielis »

Kamil, don't forget to play the lottery, your guesses are awesome !
Best regards,

Wim Gielis

IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Post Reply