COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: naveen.odi@gmail.com on 04 Dec 2014 01:02:06 AM

Title: Display First Even & then Odd rows
Post by: naveen.odi@gmail.com on 04 Dec 2014 01:02:06 AM
Hi All, i want to display first all even rows & then all odd rows in my report. Could anyone provide me steps here? Tanx...
Title: Re: Display First Even & then Odd rows
Post by: Raghuvir on 04 Dec 2014 01:28:14 AM
Quote from: naveen.odi@gmail.com on 04 Dec 2014 01:02:06 AM
Hi All, i want to display first all even rows & then all odd rows in my report. Could anyone provide me steps here? Tanx...

Hi Naveen,

Could you please explain in more detail about your requirement...

Regards
Title: Re: Display First Even & then Odd rows
Post by: naveen.odi@gmail.com on 04 Dec 2014 02:33:42 AM
My Report is,
Emp_Id     Emp_Name
22         Allan
125        James
2541       Brownie
257        Ricky
54         Mark
547        Stephen

& i want output like this(it will display first all odd rows & then all even rows)

Emp_Id     Emp_Name
22         Allan
2541       Brownie
54         Mark
125        James
257        Ricky
547        Stephen
Title: Re: Display First Even & then Odd rows
Post by: Raghuvir on 04 Dec 2014 03:28:28 AM
Quote from: naveen.odi@gmail.com on 04 Dec 2014 02:33:42 AM
My Report is,
Emp_Id     Emp_Name
22         Allan
125        James
2541       Brownie
257        Ricky
54         Mark
547        Stephen

& i want output like this(it will display first all odd rows & then all even rows)

Emp_Id     Emp_Name
22         Allan
2541       Brownie
54         Mark
125        James
257        Ricky
547        Stephen

Hi Naveen,

use the mod function...for e.g. make a new data item...in that write the mod function for e.g. mod ([EMPL_ID],2), if the EMPL_ID is a even number the remainder will be zero, whereas if the EMPL_ID is a odd number then the remainder will be one. use this new data item in the edit layout sorting.

this should fulfill your requirement. Let me know if this works

Regards
Title: Re: Display First Even & then Odd rows
Post by: naveen.odi@gmail.com on 04 Dec 2014 04:01:05 AM
Tanx Raghu, i have followed you steps upto this (EMPL_ID is a even number the remainder will be zero, whereas if the EMPL_ID is a odd number). In edit layout sorting how can we do this?
Title: Re: Display First Even & then Odd rows
Post by: Raghuvir on 04 Dec 2014 04:18:22 AM
Quote from: naveen.odi@gmail.com on 04 Dec 2014 04:01:05 AM
Tanx Raghu, i have followed you steps upto this (EMPL_ID is a even number the remainder will be zero, whereas if the EMPL_ID is a odd number). In edit layout sorting how can we do this?

Hi Naveen,

In the list, select list column body for the column EMPL_ID,  then expand the sorting option on the menu bar (AZ with an arrow) and select edit layout sorting, and add your new data item (with MOD function) to the detail sort list.

Hope you followed this. Please do try and let me know.


Regards
Title: Re: Display First Even & then Odd rows
Post by: naveen.odi@gmail.com on 04 Dec 2014 10:38:12 AM
Hi, i have tried but i didn't get output & this is my output

Country   City  Data Item2
Australia Melbourne 1
Austria Wien 0
Belgium Heverlee 1
Brazil São Paulo 0
Canada Calgary 1
Canada Toronto 0
China Shanghai 1
Finland Kuopio 0
France Lyon 1
France Paris 0
Germany Hamburg 1
Germany München 0
Italy Milano 1
Japan Osaka City 0