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

Sorting

Status
Not open for further replies.

296097

Programmer
Joined
Aug 13, 2004
Messages
32
Location
US
I have a reprot created on CR 8.5 using oracle 9i and also i have grouped my record .I created a formula to sort my report on ascending order and i do not see any sorting eventhough i used my formula to sort my records.my question is this happening because i have group on my report or is there any other mystery that i did not figure out yet.please help
Here is the formula i used for sorting:
if {PLANHOLD.VENDOR} startswith ['Dis', 'IN DIS', 'MTRO'] then '1' else
if numerictext ({PLANHOLD.VENDOR}[1]) then '2' else
'0'
and This is wher i used my grouping to get the recent date for the datepur field
{PLANHOLD.DATEPUR}=maximum({PLANHOLD.DATEPUR},{VENDOR.VENDOR})

hope i provided enough info.
thank you for the help
 
You ought to find the sort under [Report] on the menu.

When groups exist, they will be the main sort field, with other values used to sort within groups. But there are options like [Specified Order] that may be useful. Right-click on a group section and choose [Change Group]

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Please show some sample data with both group and detail records so we can see what you want the final display to look like.

-LB
 
Vendor_name Vendor_id Plan_purchase_date
Plan Room 0001 12/15/2004
Plan Room 0001 12/25/2004
Dis 1 Dis1 10/22/2001
Metro Metro 07/12/2001
Metro Metro 08/12/2001
Vendor_A A0001 04/25/2001
Vendor_A A0001 06/25/2001
Vendor_B b0001 04/12/2000
Vendor_c c0001 04/15/2001

This is not a real record from my report ..hope it will give you a clue of what i want on my real report.
The firs thing i want to do here is to select a vendor name with maximum plan_purchase date when i have same vendor with different plan_purhase_date field.second, i want to sort my record with the vendor id and i want records with letter A0001, B001, C001...to be sorted and metro and District will be sorted at the end.
If you see my previous post i did provide the formula and the group method i used.hope i supplied enough information.
thank you

 
Groups sort before other sort data. You can make your sort data formual a group. Groups can be moved above or below other groups simply by click/drag the group label on the left side of the screen.
MrBill
 
Try using a formula like the following as your Group#1:

if {table.vendorID} = "Dis1" then 1 else
if {table.vendorID} = "IN DIS" then 2 else
if {@vendorID} = "Metro" then 3 else 0

Suppress the Group #1 group header and footer.
Then use {table.vendorID} as your Group #2. You can then use a group selection formula of:

{PLANHOLD.DATEPUR}=maximum({PLANHOLD.DATEPUR},{table.vendorID})

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top