Page 1 of 1

Insert a Subset into a Subset through TI

Posted: Fri May 08, 2020 2:56 pm
by PavoGa
This can be done through the Architect Subset Editor. However, can it be done through a TI?

Re: Insert a Subset into a Subset through TI

Posted: Fri May 08, 2020 3:29 pm
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.

Re: Insert a Subset into a Subset through TI

Posted: Fri May 08, 2020 4:48 pm
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).

Re: Insert a Subset into a Subset through TI

Posted: Fri May 08, 2020 5:50 pm
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, '' );


Re: Insert a Subset into a Subset through TI

Posted: Mon May 11, 2020 12:43 pm
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.