Page 1 of 1

Does SubsetMDXSet Work?

Posted: Fri Nov 28, 2014 6:35 pm
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

Re: Does SubsetMDXSet Work?

Posted: Fri Nov 28, 2014 9:37 pm
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!

Re: Does SubsetMDXSet Work?

Posted: Mon Jan 19, 2015 5:00 pm
by image2x
Yes, thank you lotsa... that was it. I'm used to Unix commands where optional parameters mean optional!

Re: Does SubsetMDXSet Work?

Posted: Wed May 11, 2016 12:22 pm
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>, '');