COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: cognos05 on 18 Dec 2014 12:36:09 PM

Title: Sorting on a dimensional package
Post by: cognos05 on 18 Dec 2014 12:36:09 PM
I am showing reps in my column and time period  in columns with sales as Measures.

The expression for the rep given in the data item is

Order( Descendants( set(Region1,Region2),Reps),tuple(currentmember(Rep Hierarchy),[TimePeriod],[Sales],Desc)

SO I am getting the reps from 2 regions and then sorting descending.

The sorting is done by descending correctly, but the results are first the reps in region are sorted descending and displayed and then reps from region 2 are sorted descending and then displayed.

I wanted all the reps to be sorted descendaing based on the Sales value for the specified time period.

What am I missing here or how to achieve this.

Thanks,
Nithya
Title: Re: Sorting on a dimensional package
Post by: MFGF on 19 Dec 2014 01:51:54 AM
Quote from: nithya1224 on 18 Dec 2014 12:36:09 PM
I am showing reps in my column and time period  in columns with sales as Measures.

The expression for the rep given in the data item is

Order( Descendants( set(Region1,Region2),Reps),tuple(currentmember(Rep Hierarchy),[TimePeriod],[Sales],Desc)

SO I am getting the reps from 2 regions and then sorting descending.

The sorting is done by descending correctly, but the results are first the reps in region are sorted descending and displayed and then reps from region 2 are sorted descending and then displayed.

I wanted all the reps to be sorted descendaing based on the Sales value for the specified time period.

What am I missing here or how to achieve this.

Thanks,
Nithya

Hi,

A few seconds reading the Information pane for the Order function will give you the answer :)

I have copied the description here, with the relevant section in bold...

order ( set_expression , value_expression [ , ASC|DESC|BASC|BDESC ] )
Arranges the members of "set_expression" according to their "value_expression" and the third parameter. ASC and DESC arrange members in ascending or descending order, respectively, according to their position in the set hierarchy. Then the children of each member are arranged according to "value_expression". BASC and BDESC arrange members in the set without regard to the hierarchy. In the absence of an explicit specification, ASC is the default.


Cheers!

MF.