If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Dynamic Sorting based on Dimensional source

Started by Cognos10x, 20 Jul 2015 10:59:50 AM

Previous topic - Next topic

Cognos10x

Hi Experts,

I have a requirement where I have to do nested sorting on my list report based on the 3 columns the users selects. This could be ascending or Descending. I am using DMR model and my version is 10.2.2

How do I achieve this?

 

Thanks in advance.

gpollock

How about trying this:

Create a new data item in your query.  Call it Sort1.  For the expression, use a case or some other logic to give it a value based on your parameter.  For example, if param1 is "Report Date", then column Sort1 will be the date column.  If param1 is "Item", then Sort1 will be the item.  Repeat so you also have a Sort2 and a Sort3.  Then just tell your list to sort by Sort1, then Sort2, then Sort3.

Now you have the trouble of making it go ascending or descending.  It's simple if you're working with numbers, but letters may be more complicated.


Cognos10x

I am familiar with the logic part. My problem is how to make it dynamically sort it asc or desc. For instance User wants to have combination of asc or desc of col1, col2, and Col3. How can we put this logic in place?

gpollock

I don't think Cognos has any event rules, and I personally don't like using javascript in reports, so personally, I would do dynamic sorting via the case statements.  In your case, you would have six "special" columns, which are populated based on your parameters.  For more information, here's an IBM guide on how to do it. http://www.ibm.com/developerworks/data/library/cognos/reporting/scripting_techniques/page515.html

If you want to try something with javascript or use another method, there are a few guides you can find by googling "cognos report dynamic sorting"