Subset MDX Compile Error

Post Reply
User avatar
jim wood
Site Admin
Posts: 3961
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Subset MDX Compile Error

Post by jim wood »

Guys,

I'm getting strange one. On a dimension called Project_Hierarchy (Don't ask) I am able to record an expression and the subset is created generating the following MDX:

{FILTER( {TM1FILTERBYLEVEL( {TM1SUBSETALL( [Project_Hierarchy] )}, 0)}, [Project_Hierarchy].[Facility] = "A04")}

However when I go to stop recording and include the code within the subset I get the following error:
MDX Error.JPG
MDX Error.JPG (12.04 KiB) Viewed 3247 times
The Facility attribute is rule based pulling from a project attributes cube. I have checked and the rule is fed correctly.

Any ideas? I tried recording btw after I noticed that the subset (that was already created) was coming back with no content.

Cheers,

Jim.

PS. You all know how much I love MDX so you can guess how much fun I'm having with this.
Struggling through the quagmire of life to reach the other side of who knows where.
Go Build a PC
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
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: Subset MDX Compile Error

Post by lotsaram »

Is "facility" an ambiguous name? As in is it the name of either an element or a subset in the project_hierarchy dimension?
You could get rid of the ambiguity in name or else use the full MDX syntax not the TM1 shortened syntax which would be something like [project_hierarchy].CurrentMember.Properties("facility").Value
(Or something like that, but don't take it verbatim as I'm on the train on the mobile)
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
User avatar
jim wood
Site Admin
Posts: 3961
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Re: Subset MDX Compile Error

Post by jim wood »

Brilliant thanks. I think you're on to something there. In all other cases the element attribute name differs slightly from the project attribute. This also is a defined level in the hierarchy. I'll try the full strength first and let you know.

Thanks again,

Jim.

PS. I still really don't like MDX :D
Struggling through the quagmire of life to reach the other side of who knows where.
Go Build a PC
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
User avatar
jim wood
Site Admin
Posts: 3961
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Re: Subset MDX Compile Error

Post by jim wood »

Lotsaram,

You were very close and not a bad coding on your mobile. Once I took away the .value it worked a treat so the code finally looked like this:

Code: Select all

{TM1SORT( 
{
FILTER(
    {TM1SUBSETALL( [Project_Hierarchy] )},
    ([Project_Hierarchy].CurrentMember.Properties("Facility")="A04" OR [Project_Hierarchy].CurrentMember.Properties("Facility")="A43"  OR 
      [Project_Hierarchy].CurrentMember.Properties("Facility")="A44" OR [Project_Hierarchy].CurrentMember.Properties("Facility")="A49")
    )
}
, ASC)}
Thanks again,

Jim.
Struggling through the quagmire of life to reach the other side of who knows where.
Go Build a PC
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
User avatar
jim wood
Site Admin
Posts: 3961
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Re: Subset MDX Compile Error

Post by jim wood »

After applying the code I'm seeing something really funny it keeps on disappearing which is very strange. Any ideas??
Struggling through the quagmire of life to reach the other side of who knows where.
Go Build a PC
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
Post Reply