Insert a Subset into a Subset through TI

Post Reply
User avatar
PavoGa
MVP
Posts: 622
Joined: Thu Apr 18, 2013 6:59 pm
OLAP Product: TM1
Version: 10.2.2 FP7, PA2.0.9.1
Excel Version: 2013 PAW
Location: Charleston, Tennessee

Insert a Subset into a Subset through TI

Post by PavoGa »

This can be done through the Architect Subset Editor. However, can it be done through a TI?
Ty
Cleveland, TN
User avatar
gtonkin
MVP
Posts: 1261
Joined: Thu May 06, 2010 3:03 pm
OLAP Product: TM1
Version: Latest and greatest
Excel Version: Office 365 64-bit
Location: JHB, South Africa
Contact:

Re: Insert a Subset into a Subset through TI

Post by gtonkin »

To the best of my knowledge, going with a No as the Insert subset creates the pseudo element with the Subset name as a consolidation holding the members of the inserted subset.

If you use TI, you will need to use MDX and to my knowledge you will only be able to add members, not create these user defined rollups or pseudo element.

Using TM1SubsetToSet will merely add the members without a consolidation. If that is all you need then maybe the use of an SubsetMDXGet and a SubsetMDXSet could get you to your new set.
BR, George.

Learn something new: MDX Views
lotsaram
MVP
Posts: 3703
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: Insert a Subset into a Subset through TI

Post by lotsaram »

PavoGa wrote: Fri May 08, 2020 2:56 pm This can be done through the Architect Subset Editor. However, can it be done through a TI?
No it can't. Paste via Perspectives/Architect is the only way to achieve this. (Unless you want to roll your own UI with the old C API).
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
Emixam
Regular Participant
Posts: 156
Joined: Tue May 21, 2019 3:33 pm
OLAP Product: TM1
Version: PA 2.0.x
Excel Version: 2016
Location: The Internet

Re: Insert a Subset into a Subset through TI

Post by Emixam »

You probably already know but if you want to "merge" 2 subsets togheter, you can use Union. Through a TI, this little piece of code can easily do that :

Code: Select all

sDimName = 'Account';
sSubset1 = 'Subset1';
sSubset2 = 'Subset2';
sNewSubsetName = 'My new subset Name';

sMDX = '{ UNION( 
	[' | sDimName | '].[' | sSubset1 | '],[' | sDimName | '].[' | sSubset2 | '])}';

IF( SubsetExists( sDimName, sNewSubsetName ) = 1 );
	SubsetDestroy( sDimName, sNewSubsetName );
ENDIF;
SubsetCreatebyMDX( sNewSubsetName, sMDX, sDimName );

# If you want to make it static
SubsetMDXSet( sDimName, sNewSubsetName, '' );

User avatar
PavoGa
MVP
Posts: 622
Joined: Thu Apr 18, 2013 6:59 pm
OLAP Product: TM1
Version: 10.2.2 FP7, PA2.0.9.1
Excel Version: 2013 PAW
Location: Charleston, Tennessee

Re: Insert a Subset into a Subset through TI

Post by PavoGa »

lotsaram wrote: Fri May 08, 2020 4:48 pm
PavoGa wrote: Fri May 08, 2020 2:56 pm This can be done through the Architect Subset Editor. However, can it be done through a TI?
No it can't. Paste via Perspectives/Architect is the only way to achieve this. (Unless you want to roll your own UI with the old C API).
There is a difference between a subset file created through the UI and the TI, so I even tried manipulating the *.sub file. Nope. Apparently when the subset is registered, any file manipulation is not recognized AND is overwritten when the server shutsdown, which was not a surprise, just a forlorn hope.

Oh well, for now on to a less elegant solution.
Ty
Cleveland, TN
Post Reply