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

Force record sort and ignore group sort

Status
Not open for further replies.

capronton

MIS
Jun 28, 2013
159
US
The data set below has the correct sort, however when I refresh the data it uses the group sort and
disrupts any calculations I have made on the data sorted as you see below. Also when I choose "original order",
this also sorts the data in a way that disrupts calculations.

Can I use specified order to sort the fields as shown below. For exeample, suppose I want the data sorted
in this order
ORDER BY tDate, route, direction, sequence, timepoint

Could I force this sort somehow and also group by vehicle?


incLogID tDate minArrival incTime bus
5011
148430872 2/23/16 4:58:54 4:58:54 5011
5018
148432058 2/23/16 5:13:54 5:13:54 5018
148432530 2/23/16 5:13:54 5:18:54 5018
148432610 2/23/16 5:13:54 5:19:54 5018
5008
148433982 2/23/16 5:31:54 5:31:54 5008
5009
148435548 2/23/16 5:43:55 5:43:55 5009
148435682 2/23/16 5:43:55 5:44:55 5009
148436396 2/23/16 5:43:55 5:49:55 5009
148436682 2/23/16 5:43:55 5:51:55 5009
5017
148437758 2/23/16 5:58:55 5:58:55 5017
5010
148440910 2/23/16 6:14:55 6:14:55 5010
5021
148442678 2/23/16 6:22:55 6:22:55 5021
5015
148445796 2/23/16 6:36:55 6:36:55 5015
5007
148449412 2/23/16 6:51:55 6:51:55 5007
5013
148452618 2/23/16 7:04:56 7:04:56 5013
148452900 2/23/16 7:04:56 7:05:56 5013
148453120 2/23/16 7:04:56 7:06:56 5013
 
Try the following;
Group by Vehicle Id. Leave it as Ascending order (and forget about Original Order as that doesn't seem to be working out)
Insert Summary and choose Maximum of the Arrival time for the Vehicle Id Group.
Use the Group Sort Expert to now sort the groups based on the Maximum Arrival Time in Ascending Order.
Groups should now be in the correct order - 5011, 5018, 5008 etc...




Gordon
Crystalize
 
Thanks Gordon! I tried your suggestion above and data is still not sorting correctly.

I did however create a view that forces the record sort and ignores the group sort when I choose "original order".

This is working, but the "VIEW" takes much longer for users to run the report. I'm currently looking into ways of
speeding up the "VIEW" query results.

Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top