Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Impromptu Sorting

Status
Not open for further replies.

spicysudhi

Programmer
Nov 10, 2003
575
FR
Hi

I want get the prompt for sorting of few columns in the report,,,, hwo to do this,

thanks

sudhi
 
sudhi,

To create a dynamically sorted report, create a calculated column (I call it SortKey) in your report, then base the contents on a prompt input, as in:

If(?prompt? = 'A') then (acct) else if (?prompt? = 'P') then (project) else (dept) ...

Then sort the report by this calculated column.

Hope this helps,

Dave Griffin



The Decision Support Group
Reporting Consulting with Cognos BI Tools
"Magic with Data"
[pc2]
Want good answers? Read FAQ401-2487 first!
 
thanks,

I am trying to sort on the single column either in ASC or DESC order. For example, on Dept No wise, If user selects ASC, then report should be sorted in DEPTNOwise in ASC order else in DESC order.

from ur soln i can understand that we can design report where sorting columns will be different. again in this, is the calculated column also not a part of report? if yes, thats being duplicated right?

regards,
sudhi
 
Sudhi,
If I can take up Dave's suggestion, make 2 calculated columns:
SortASC as IF(?prompt?="ASC") then DEPTNOWISE else NULL
SortDESC as IF(?prompt? = "DESC") then DEPTNOWISE else NULL
and sort the first in ascending order and the second in descending order.
lex
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top