COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: cognos05 on 29 Jan 2015 10:07:00 AM

Title: Sorting on two columns
Post by: cognos05 on 29 Jan 2015 10:07:00 AM
Hi ,
I am using Dimensional reporting.
I have a crosstab with two columns, Status and Total

I want to first sort by status column  and then on total column. How to achieve this.

Say I am using order () function I can sort on only one column .

Thanks,
Nithya
Title: Re: Sorting on two columns
Post by: MFGF on 29 Jan 2015 10:12:49 AM
Quote from: nithya1224 on 29 Jan 2015 10:07:00 AM
Hi ,
I am using Dimensional reporting.
I have a crosstab with two columns, Status and Total

I want to first sort by status column  and then on total column. How to achieve this.

Say I am using order () function I can sort on only one column .

Thanks,
Nithya

What are you sorting - rows or columns? Are the items nested, stacked? How is the total being delivered - is it a summary from the toolbar? A query calculation (if so, what syntax)? Something else?

MF.

MF.
Title: Re: Sorting on two columns
Post by: cognos05 on 29 Jan 2015 10:38:26 AM
I have Reps and Accounts nested under in rows which is from a same hierarchy .

In Columns I have a a total (current Measure within set ([jun2014],[July2014],[Aug2014]) column and Status column Having text like Active /Inactive.

I wanted to sort based on all the inactive accounts with highest total irrespective of accounts and reps.

I tried selecting Accounts and go to sorting and then select both status and total column and sort descending.but it throwed me error stating cn node value.

Thanks,
Nithya
Title: Re: Sorting on two columns
Post by: cognos05 on 29 Jan 2015 11:14:34 AM
I actually had removed the total summary column and added a new data item with expression total(currentmeaseure within set (Time))

And went to the accounts dataitem in row , sorting added both stats and Total and sorted.

It did worked.

1)My question is difference between automatically creating summary total -why does this throw error on sorting and same exprssion is written on a dataitem and then sorted doesnt throw any error.

2) Also now it sorts by rep and accounts inside them.. I want it to be like Any account with in the reps in an order.

Example
               Total   Stats
A    A1      100    A
      A2       90     A
      A3       60     I
                 
B   B1        80    A
     B2        60    A
     B3        40    I

I want the output to be like

              Qty   Stats
A A1       100     A
    A2         90    A
B  B1         80    A

A   A3       60      I
B    B2      60     A
       B3      40     I

Thanks,
Nithya 
Title: Re: Sorting on two columns
Post by: MFGF on 29 Jan 2015 11:49:06 AM
Quote from: nithya1224 on 29 Jan 2015 11:14:34 AM
I want the output to be like
              Qty   Stats
A A1       100     A
    A2         90    A
B  B1         80    A

A   A3       60      I
B    B2      60     A
       B3      40     I

Thanks,
Nithya

That's not the way sorting works with nested row headings. If you apply a sort, it will respect the nesting levels.

MF.
Title: Re: Sorting on two columns
Post by: cognos05 on 29 Jan 2015 12:31:58 PM
Got it. Thanks.