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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Header row sorting in matrix reports

Status
Not open for further replies.

haste

Programmer
Feb 27, 2005
96
GH
Am trying to reformat a matrix report that shows sales for each customer for a variable no. of months. The result is something like:

Month Jan Feb mar ...
Cust1
cust2
cust3


The query that produces the results consists of a union of two statements.

The problem is that given a range say december 2004 to feb 2005 the header column sorts the months like they were in the same year, like this

Month Jan Feb Dec
Cust1
cust2
cust3

Av tried using ORDER BY in the union'd statement but to no success. Is there anyway to sort the month header?
 
Add another column to your query that would return month naturally sorted, for example add year to it, like
to_char(your_date_field, 'YYYY-MM').
Then drag this new column to the column-generating group in the matrix data model. The column should be first in the group. Make sure there is an Ascending break order on this new column. You don't need to put the column to the layout, just to the data model. Now the months in the matrix should be sorted correctly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top