Page 1 of 1

Using SubsetCreatebyMDX in a TI

Posted: Thu Aug 12, 2010 9:17 am
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

Re: Using SubsetCreatebyMDX in a TI

Posted: Thu Aug 12, 2010 9:20 am
by Wim Gielis
Does the subset already exist? If yes, try to insert a SubsetDestroy command.

Re: Using SubsetCreatebyMDX in a TI

Posted: Thu Aug 12, 2010 10:18 am
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