• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2293
  • Last Modified:

DYNAMICALLY SORTING COLUMNS IN COGNOS REPORT STUDIO

i HAVE TWO COLUMNS BRANCH CODE , STAFF CODE AND SALARIES OF STAFF.  IN MY REPORT OUT PUT I HAVE TWO RADIO BUTTONS IN THE PROMPT FOR ASCENDING AND DESCENDING. SO WHEN I SELECT ASCENDING, MY REPORT SHOULD BE IN ASCENDING ORDER OF SALARY AND VICE VERSA WHEN I SELECT DESCENDING...

I HAVE DONE IT BY CREATING A DATA ITEM..AND  USING STATIC VALUES 1 AND -1... BUT I WAS TOLD THAT IT IS NOT THE OPTIMAL SOLUTION...PLEASE SUGGEST AN OPTIMAL SOLUTIONS

REGARDS
SAM
0
Sam2009
Asked:
Sam2009
  • 2
1 Solution
 
SNeupaneCommented:
There are different ways of doing this.
Your approach is good.
Few other methods are here:
1. Use a conditional block to create separate lists for each sort order and use auto submit on drop down prompt in report page so users don't have to go back to prompt page for sorting.
2. Use javascript to show/hide report depending upon sort order (only works with HTML).
0
 
Sam2009Author Commented:
Hi
Thanks for the genuine reply...but is there a way to do without creating separate lists..

Regards
Sam
0
 
SNeupaneCommented:
Your approach is okay if you want to do in the same list.
Anytime sorting is changed, the query is different so regardless, the query will be sent to the db and cached results won't be used.
You can also duplicate the sort column and sort one asc another desc.
Then use a conditional variable to render one depending upon the selection.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Network Scalability - Handle Complex Environments

Monitor your entire network from a single platform. Free 30 Day Trial Now!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now