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

Sort order determined by group value

Status
Not open for further replies.

WestView

Technical User
Jan 7, 2003
67
US
Hello All,

I have a fairly simple report that has two groups:

Group1: Based on a field called “Status” (i.e. retired, active, potential)
Group2: Based on the record ID (a details section)

What I want to do is sort the report on certain date fields according to the “Status” group value. For example, if the Status group is Retired I want to sort that section by a field called Retired_Date. If the group is Active, I want to sort that group by Active_Date.

Is this possible?

Any/all help would be greatly appreciated!!!

- Tom
 
I assume that you mean you want to sort the details within the Status group by another column, however understand that the Group field will still be sorted first.

Since you show 2 current groups, then the data will first be sorted by those groups, and any sortation applied will be to the details within those.

Since you're already sorting (grouped) by the record ID, this seems like a mistake.

Remove the record ID grouping and replace it with a formula such as:

if {table.Status} = "Retired" then
{table.ret_date}
else
if {table.Status} = "Active" then
act_date
etc....

Now the secondary grouping will be based on this formula, and you can then add in a group or sort by the record id if desired.

-k
 
synapsevampire,

Perfect! Exactly what I wanted.

Thanks a bunch!!!

- Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top