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

Change group order by parameter

Status
Not open for further replies.

kpetree10

IS-IT--Management
Jun 15, 2007
57
US
Hi All. I've got a report that has four groups and shows/supresses the groups based on a parameter. My problem is that it's not sorting right because the group selected could be group 4 and it's sorting by the other ones first. How can I make it so that the selected group is pushed to group 1 so it's sorted right?

Thanks in advance!
 
Why do you have four groups? If you have one parameter and there are four parameter options, then you should group on a formula like this instead of adding four groups and using suppression:

select {?group}
case "Date" : totext({table.date},"yyyy-MM-dd")
case "Name" : {table.name}
case "Amount" : totext({table.amt},2)//2 decimals
case "NumberID" : totext({table.ID},"0000")

-LB
 
Where would I put that formula? How do I group on a formula?
 
Go to the field explorer->formulas->new and enter it there. Then go to insert->group->select the formula to group on.

-LB
 
I can't beleive I missed that. Ok so that's working now but what is the formula so that based on how I'm grouping it, it will sort it that way. Right now if I have group by employee I have to go into the sort expert and change it to employee.
 
If you are grouping on the formula and the parameter = "Employee", then your sort will automatically be by employee first, since groups have precedence over record sorts. If you have more than one group, then you need to explain what you are grouping on and how you want the results to look.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top