Jump to content
We've recently updated our Privacy Statement, available here ×

how to set order by exp in crosstab?


shivareddyk

Recommended Posts

  • 4 weeks later...
  • Replies 10
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 weeks later...

For my case I have a list of names that I wanted odered in my own way. The way I got this to work was to add a coulumn called sort order to my table. The crosstab still sorted on name, so I pre-pended the sort order string to my sorted row in the query. My name now looks like "1-PartnerName", 4-PartnerName", etc.

In the query I used: 

        concat(concat(cast(c.display_order as char), '-'), c.name)  As PartnerName,

Now once I go to the crosstab element and change the expression to get rid of the starting int:

        $V{PartnerName}.substring($V{PartnerName}.indexOf("-")+1)

This gives me back the name in the order I decided on. If anyone has an easier way to do this I would love to hear about it.

Link to comment
Share on other sites

  • 3 weeks later...

 Hi!!!

 

I have try your trick with the numbers but when i substring the parameter, my order got lost again, have anyone already solved this?

The query i made from my data base is in the order i desire, my problem is that the croostab re-order the data

Link to comment
Share on other sites

  • 4 weeks later...

 The problem for me was to get months in the right order, not alphabetic order, to solve this i got the number and name for each month, sort the crosstab by number and delete the display field from report.

If you can manage to set the right order in an additional field form your Data base query and then delete the display field you will solve your problem.

Hop this help you

Link to comment
Share on other sites

  • 3 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...