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
Sam2009Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Databases

From novice to tech pro — start learning today.