Using SubsetCreatebyMDX in a TI

Post Reply
dan.kelleher
Community Contributor
Posts: 128
Joined: Wed Oct 14, 2009 7:46 am
OLAP Product: TM1
Version: 9.4
Excel Version: 11
Location: London

Using SubsetCreatebyMDX in a TI

Post by dan.kelleher »

Hi,

I'm having trouble creating a dynamic subset in MDX, getting an error:

"Account Director",Data Source line (1) Error: MetaData procedure line (10): Could not create dynamic subset:

Here is my TI Process code:

Code: Select all



#****Begin: Generated Statements***
#****End: Generated Statements****

strMDX1 = '{FILTER( { HIERARCHIZE( {TM1SUBSETALL( [Resource] )} ) }, [Resource].[' | strRole;
strMDX2 = '] = "1" )}';

TextOutput('C:\Temp\Debug_Metadata.txt', strMDX1 |  strMDX2);

SubsetCreatebyMDX(strRole | '_subset', strMDX1 | strMDX2);

This is what my debug text file produces:

"{FILTER( { HIERARCHIZE( {TM1SUBSETALL( [Resource] )} ) }, [Resource].[AccountDirector] = "1" )}"

Which works fine when I paste it into my MDx expression window in the Resource subset editor.

Any ideas would be much appreciated. Could this have anything to do with the fact that it's a blank subset once it's created?

Thanks,

Dan
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: Using SubsetCreatebyMDX in a TI

Post by Wim Gielis »

Does the subset already exist? If yes, try to insert a SubsetDestroy command.
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
dan.kelleher
Community Contributor
Posts: 128
Joined: Wed Oct 14, 2009 7:46 am
OLAP Product: TM1
Version: 9.4
Excel Version: 11
Location: London

Re: Using SubsetCreatebyMDX in a TI

Post by dan.kelleher »

Yes, I was running that in another process.

For some reason it didn't like creating an empty dynamic subset so I've forced it to have at least 1 element. Works fine now.

Thanks for the suggestion.

Dan
Post Reply