Creating Subset in TI and sorting via Attribute

Post Reply
cdhodge2002
Posts: 90
Joined: Tue Aug 19, 2008 4:56 pm

Creating Subset in TI and sorting via Attribute

Post by cdhodge2002 »

I am creating an employee picklist for a cube that is department specific. To do this I create these picklist via a TI process whenever I receive a new employee file. This TI process references a attribute cube that contains the different department employee combinations.

However the client would like to see the picklist in alphabetical order and not employee number order. I believe using an MDX statement to create the subset for the employee dimension in the attribute cube is the way to do this and have read that other people have had success doing this. However my MDX is horrible and was wondering if someone could help me with this.

I know this is the MDX I need to order by subset by attribute ORDER({[Employee].Members}, [Employee].EMPLOYEENAME, BASC)

However I need to incorporate it into my current mdx statement which grabs all 0 level items
{TM1FILTERBYLEVEL( {TM1DRILLDOWNMEMBER( [employee], ALL, RECURSIVE )}, 0)}

How can I incorporate both of these items into an mdx statement?
User avatar
qml
MVP
Posts: 1098
Joined: Mon Feb 01, 2010 1:01 pm
OLAP Product: TM1 / Planning Analytics
Version: 2.0.9 and all previous
Excel Version: 2007 - 2016
Location: London, UK, Europe

Re: Creating Subset in TI and sorting via Attribute

Post by qml »

Code: Select all

{ORDER( {TM1FILTERBYLEVEL( {TM1DRILLDOWNMEMBER( [Employee], ALL, RECURSIVE ) }, 0) }, [Employee].EMPLOYEENAME, BASC) }
Kamil Arendt
cdhodge2002
Posts: 90
Joined: Tue Aug 19, 2008 4:56 pm

Re: Creating Subset in TI and sorting via Attribute

Post by cdhodge2002 »

I had tried that and this is the error I get.

Syntax error at or near: ' ALL, RECURSIVE ) }, 0) }, [employe ... ', character position 64 expression:
User avatar
qml
MVP
Posts: 1098
Joined: Mon Feb 01, 2010 1:01 pm
OLAP Product: TM1 / Planning Analytics
Version: 2.0.9 and all previous
Excel Version: 2007 - 2016
Location: London, UK, Europe

Re: Creating Subset in TI and sorting via Attribute

Post by qml »

Try this:

Code: Select all

{ORDER({TM1FILTERBYLEVEL( {TM1SUBSETALL( [Employee])}, 0)}, [Employee].[EmployeeName], BASC)}
Kamil Arendt
rmackenzie
MVP
Posts: 733
Joined: Wed May 14, 2008 11:06 pm

Re: Creating Subset in TI and sorting via Attribute

Post by rmackenzie »

cdhodge2002 wrote:How can I incorporate both of these items into an mdx statement?
MDX allows you to nest different expressions inside one another as qml's code snippet shows. As long as you have a statement that works then you can pass that in to another function.
Robin Mackenzie
Post Reply