COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: ankur10 on 12 Sep 2017 04:32:44 AM

Title: Sorting of Data? Please help
Post by: ankur10 on 12 Sep 2017 04:32:44 AM
I wanted to sort the data based on the specifc name, so that the name which we wanted comes first in the list report. I have basically 4 names just. Names which i want to sort 1- Ending Confirmed 2- Ending Likely 3- Ending TBD 4- Extension Confirmed. Please help/ Guide me.

Sent from my MotoE2 using Tapatalk

Title: Re: Sorting of Data? Please help
Post by: hespora on 12 Sep 2017 05:17:21 AM
create a new data item "Sort" as follows:

case
when [name] = 'Ending confirmed' then 1
when [name] = 'Ending likely' then 2
when [name] = 'Ending tbd' then 3
when [name] = 'Extension confirmed' then 4
else 99
end


Select your data container. In the properties, find a property called "properties" (yes. really.). Open that up and check your new data item "sort". Now, find the "grouping and sorting" property, and sort by your "sort" item ascending.

For debugging, add your data item to the datacontainer. Depending on DB used, case sensitivity may be a thing in the comparison.
Title: Re: Sorting of Data? Please help
Post by: ankur10 on 12 Sep 2017 07:47:56 AM
Quote from: hespora on 12 Sep 2017 05:17:21 AM
create a new data item "Sort" as follows:

case
when [name] = 'Ending confirmed' then 1
when [name] = 'Ending likely' then 2
when [name] = 'Ending tbd' then 3
when [name] = 'Extension confirmed' then 4
else 99
end


Select your data container. In the properties, find a property called "properties" (yes. really.). Open that up and check your new data item "sort". Now, find the "grouping and sorting" property, and sort by your "sort" item ascending.

For debugging, add your data item to the datacontainer. Depending on DB used, case sensitivity may be a thing in the comparison.
Thank you soo much for your time and help. I appreciate it. I will try this and let you know.

Sent from my MotoE2 using Tapatalk

Title: Re: Sorting of Data? Please help
Post by: ankur10 on 14 Sep 2017 04:25:38 AM
Hello,

Sorry to bother you. Can you please tell me how to sort 2 column one is ascending and other in descending. If i apply ascending on one column and try to apply descending on other then ascending sorting is removed. Please guide how to apply sorting on both.

Thank you,
Ankur
Title: Re: Sorting of Data? Please help
Post by: hespora on 14 Sep 2017 06:51:41 AM
select any data item in your list
in the icons, click the drop down for sorting
select "edit layout sorting"
in the window that opens: drag the fields you wan to sort on from your data items on the left to "detail sort list" on the right.
Title: Re: Sorting of Data? Please help
Post by: ankur10 on 15 Sep 2017 03:37:44 AM
Thank you so much. I will try this and let you know.

Sent from my MotoE2 using Tapatalk

Title: Re: Sorting of Data? Please help
Post by: ankur10 on 21 Sep 2017 11:31:58 PM
Thank you so much for the help and time, I am able to do it. I was earlier not dragging the field. I appreciate your time and help.
Title: Re: Sorting of Data? Please help
Post by: Michael75 on 22 Sep 2017 02:38:56 AM
Here's the Edit Layout Sorting for a report with multiple sort keys.

(https://image.ibb.co/hMo2EQ/Multiple_Sort_Keys.png) (http://<img%20src="https://image.ibb.co/hMo2EQ/Multiple_Sort_Keys.png"%20alt="Multiple_Sort_Keys"%20border="0">)

The first and third keys are set to sort ascending, the second and fourth to sort descending.
Title: Re: Sorting of Data? Please help
Post by: ankur10 on 25 Sep 2017 03:29:47 AM
Hello Michael,

Thank you for the reply. I got that finally how to do it, thank you soo much for the help