Dynamic Subset Created by MDX in TI Process

Post Reply
danpassfield
Posts: 2
Joined: Thu Feb 20, 2014 10:05 am
OLAP Product: BLAH
Version: 9.5.1
Excel Version: Office 10

Dynamic Subset Created by MDX in TI Process

Post 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
Wim Gielis
MVP
Posts: 3240
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: Dynamic Subset Created by MDX in TI Process

Post by Wim Gielis »

Hello,

Can you try:

Code: Select all

SubsetCreatebyMDX('TargetDimension', '{FILTER( {TM1SUBSETALL( [TargetDimension] )}, [TargetDimension].[Attribute] ="'| Parameter | '")}');
I added double quotes.
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
danpassfield
Posts: 2
Joined: Thu Feb 20, 2014 10:05 am
OLAP Product: BLAH
Version: 9.5.1
Excel Version: Office 10

Re: Dynamic Subset Created by MDX in TI Process

Post by danpassfield »

Hi Vim,

Thank you very much, that worked perfectly :)

Kind Rgds
Dan
lotsaram
MVP
Posts: 3704
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: Dynamic Subset Created by MDX in TI Process

Post 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.
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
Duncan P
MVP
Posts: 600
Joined: Wed Aug 17, 2011 1:19 pm
OLAP Product: TM1
Version: 9.5.2 10.1 10.2
Excel Version: 2003 2007
Location: York, UK

Re: Dynamic Subset Created by MDX in TI Process

Post 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.
Post Reply