OLAP DataItem Sort Use Cases.

Example 1: Sorted by measure amount for 1993.

MDX Generated:

> SELECT {[TIME].[All Time].[1993]} ON COLUMNS,

> ORDER ( {[GEOGRAPHIC].[COUNTRY].MEMBERS}, (Measures.[ACTUAL_AVG], [TIME].[All Time].[1993]), DESC) ON ROWS FROM PRDMDDB WHERE ([Measures].[ACTUAL_AVG])

Sample Code to use:

> List sortCriteria = new ArrayList();

> String[] measures = { measure };<<== where name is [ACTUAL_AVG]

> String[] members = { member };<<=== where name is [TIME].[All Time].[1993]

> sortCriteria.put(measures);

> sortCriteria.put(members);

> d ataItem.setSortCriteria(sortCriteria)

> d ataItem.setSortDirection(DataItemActionType.SORT_HIERARCHY_DESCENDING); <<=== where dataitem is COUNTRY

Example 2: Sorted by country label

MDX Generated:

> SELECT {[TIME].[YEAR].MEMBERS} ON COLUMNS,

> ORDER ( {[GEOGRAPHIC].[COUNTRY].MEMBERS}, [GEOGRAPHIC].CURRENTMEMBER.Name, DESC) ON ROWS

> FROM PRDMDDB WHERE ([Measures].[ACTUAL_AVG])

Sample Code to use:

> dataItem.setSortDirection(DataItemActionType.SORT_HIERARCHY_DESCENDING); <<=== where dataitem is COUNTRY