Does SubsetMDXSet Work?

Post Reply
image2x
Posts: 125
Joined: Tue Jun 02, 2009 7:05 pm
OLAP Product: TM1, PAX, PAW, SPSS
Version: 2.0.916.10 on RHEL
Excel Version: 2016
Location: Minneapolis, MN

Does SubsetMDXSet Work?

Post by image2x »

I'm testing TM1's 10.2.2 FP1 undocumented SubsetMDXSet function ( see http://www-01.ibm.com/support/docview.w ... wg27042401 ) and thus far cannot get it to function as documented:

Code: Select all

### total_lvl_0_w_alias
vDim = 'Legal_Entity';
vMdx = '{[legal_entity].[Total Company],TM1SORT( {TM1FILTERBYLEVEL( {TM1DRILLDOWNMEMBER( {[legal_entity].[Total Company]}, ALL, RECURSIVE )}, 0)}, ASC)}';
vSubset = 'total_lvl_0_w_alias';
SubsetCreatebyMDX ( vSubset, vMdx );
SubsetMDXSet ( vDim, vSubset );
The documentation is unclear on if the subset needs to already exist which is why I have the SubsetCreateByMDX statement included. Results:
* If dynanmic subset already exists, there is no conversion to a static subset.
* If run as 'SubsetMDXSet ( vDim, vSubset, vMdx)', no subset is created.
-- John
lotsaram
MVP
Posts: 3651
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: Does SubsetMDXSet Work?

Post by lotsaram »

From your code snippet it doesn't look like you're using SubsetMDXSet correctly as it's missing the 3rd argument of the MDX to pass in to reset the subset!
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
image2x
Posts: 125
Joined: Tue Jun 02, 2009 7:05 pm
OLAP Product: TM1, PAX, PAW, SPSS
Version: 2.0.916.10 on RHEL
Excel Version: 2016
Location: Minneapolis, MN

Re: Does SubsetMDXSet Work?

Post by image2x »

Yes, thank you lotsa... that was it. I'm used to Unix commands where optional parameters mean optional!
buncikp
Posts: 16
Joined: Tue Feb 12, 2013 7:31 am
OLAP Product: TM1+Cognos Express
Version: 9.5.2+10.1+10.2
Excel Version: 2007+2010
Location: Prague

Re: Does SubsetMDXSet Work?

Post by buncikp »

image2x wrote:I'm testing TM1's 10.2.2 FP1 undocumented SubsetMDXSet function ( see http://www-01.ibm.com/support/docview.w ... wg27042401 ) and thus far cannot get it to function as documented:

Code: Select all

### total_lvl_0_w_alias
vDim = 'Legal_Entity';
vMdx = '{[legal_entity].[Total Company],TM1SORT( {TM1FILTERBYLEVEL( {TM1DRILLDOWNMEMBER( {[legal_entity].[Total Company]}, ALL, RECURSIVE )}, 0)}, ASC)}';
vSubset = 'total_lvl_0_w_alias';
SubsetCreatebyMDX ( vSubset, vMdx );
SubsetMDXSet ( vDim, vSubset );
The documentation is unclear on if the subset needs to already exist which is why I have the SubsetCreateByMDX statement included. Results:
* If dynanmic subset already exists, there is no conversion to a static subset.
* If run as 'SubsetMDXSet ( vDim, vSubset, vMdx)', no subset is created.
-- John
If I got it correctly the way to use the function on subset from scratch (just make sure to have SubsetName not coliding with existing one):

Code: Select all

# Create empty subset
SubsetCreate(<DimName>, <SubsetName>);
# Attach MDX and make it dynamic
SubsetMDXSet(<DimName>, <SubsetName>, <MDXQuery>);
# Detach MDX query and make it static
SubsetMDXSet(<DimName>, <SubsetName>, '');
Post Reply