Page 1 of 1

Dynamic Subset Created by MDX in TI Process

Posted: Tue Sep 08, 2015 7:47 am
by danpassfield
Hi,

I was wondering if i could troubole any of the guru's out there for a bit of advice?!

I am creating a Dynamic Subset, based on an attribute of a dimension and selected using a Parameter from a TI process. When i save the process, it accepts it, when i run it, it comes up with an error unfortunately.

The message i am getting is :

Level or member name is ambiguous.

It then lists two other dimensions that the element appears in, but they are not in the cube I am trying to update at all, which i thought was strange as i would have thought it was obvious what Dimension i am wanting to create this subset in from the syntax alone.

The element selected actually comes from a parameter within the process.

Here is my MDX syntax :

SubsetCreatebyMDX('TargetDimension', '{FILTER( {TM1SUBSETALL( [TargetDimension] )}, [TargetDimension].[Attribute] ='|Parameter|')}');

(The Parameter is hard coded for now until the process works and is put into an application and therefore cell referenced.

Any help would be gratedully received.

Rgds
Dan

Re: Dynamic Subset Created by MDX in TI Process

Posted: Tue Sep 08, 2015 8:34 am
by Wim Gielis
Hello,

Can you try:

Code: Select all

SubsetCreatebyMDX('TargetDimension', '{FILTER( {TM1SUBSETALL( [TargetDimension] )}, [TargetDimension].[Attribute] ="'| Parameter | '")}');
I added double quotes.

Re: Dynamic Subset Created by MDX in TI Process

Posted: Tue Sep 08, 2015 8:48 am
by danpassfield
Hi Vim,

Thank you very much, that worked perfectly :)

Kind Rgds
Dan

Re: Dynamic Subset Created by MDX in TI Process

Posted: Tue Sep 08, 2015 11:34 am
by lotsaram
It looks like your error message wasn't exactly helpful and you were trying to evaluate the wrong data type. In MDX strings always need double quotes.

Another thing you do need to be aware of is that the MDX recorder writes out the shorthand and inexact attribute referencing. With the MDX recorder you get Dimension.Attribute = "value" the problem is that this can conflict with a member expression if an attribute and a member have the same name in which case the shorthand will fail due to ambuguity. In that case you need to write out the full expression Dimension.CurrentMember.Properties("Attribute") = "value"
IMO it would be preferable if the recorder gave you the full syntax as its safer.

Re: Dynamic Subset Created by MDX in TI Process

Posted: Tue Sep 08, 2015 12:37 pm
by Duncan P
If you run this when for some reason no elements are returned by the filter, then your SubsetCreateByMdx call will fail.

This, and its solution, is discussed in this thread.