Page 1 of 1

SubsetMDXSet and SubsetCreatebyMDX error

Posted: Tue Oct 08, 2024 8:11 am
by gmunoz
Hi Everyone.

I am modifying an already created an functioning process that modify subsets of 3 dimensions with inputs from the user and with that 3 subsets generates a MDX view that is used in the said process as a datasource. This is all made in prologue.

Yesterday i added a new dimension using the same code that is working in the other 3 dimension, this is a simplified version.

Code: Select all


PayElementMDXQuery = '[Int_Pay_Element].[Int_Pay_Element].[900]';

if (SubsetExists( 'Int_Pay_Element', '2D_Report_PayElement' ) = 1);
    
    SubsetMDXSet( 'Int_Pay_Element', '2D_Report_PayElement', PayElementMDXQuery );

else;

    SubsetCreatebyMDX( '2D_Report_PayElement', PayElementMDXQuery ,1  );   
When i use this MDX Expression in the subset editor works fine, as the dimension is very simple, so is the query. I have tried to to delete and create the subset manually changing names, trying to create the subset with a line of code in another process but i always get this simple error.
Process error log
Process "Write_2D_Report" aborted with errors
Error: Prolog procedure line (74): Could not create dynamic subset:
[Int_Pay_Element].[Int_Pay_Element].[900] expression:
<2>
or
Process error log
Process "Write_2D_Report" aborted with errors
Error: Prolog procedure line (79): Could not create dynamic subset:
expression:
[Int_Pay_Element].[Int_Pay_Element].[900]
depending if I create manually the susbet or if i delete it.

Thank you very much and feel free to ask for more context if it's needed.

Re: SubsetMDXSet and SubsetCreatebyMDX error

Posted: Tue Oct 08, 2024 10:38 am
by MarenC
Hi,

try this:

Code: Select all

PayElementMDXQuery = '{[Int_Pay_Element].[Int_Pay_Element].[900]}';
Maren

Re: SubsetMDXSet and SubsetCreatebyMDX error

Posted: Tue Oct 08, 2024 11:01 am
by gmunoz
MarenC wrote: Tue Oct 08, 2024 10:38 am Hi,

try this:

Code: Select all

PayElementMDXQuery = '{[Int_Pay_Element].[Int_Pay_Element].[900]}';
Maren
It works!!! Thank you very much.

Re: SubsetMDXSet and SubsetCreatebyMDX error

Posted: Tue Oct 08, 2024 1:15 pm
by Steve Rowe
It's worth noting that the set editor in PA no longer requires / displays the opening set of curly brackets.
If you are using the MDX from the set editor to derive the MDX for the MDX set you are building you need to remember to add the curly brackets back as the TI functions require the opening curly brackets.

(Posted as an explanation as to why the OP maybe got to where they did)

Re: SubsetMDXSet and SubsetCreatebyMDX error

Posted: Tue Oct 08, 2024 1:34 pm
by MarenC
It's worth noting that the set editor in PA no longer requires / displays the opening set of curly brackets.
I did wonder why gmunoz was saying the MDX expression was working in the set editor, so indeed useful to know.

Maren