CR 11 on a sql database.
This report is a logistics report that is supposed to replace a spreadsheet. The idea behind the report is to track a load from the point it is dispatched until the load is dropped off in the customers drop lot. The unit moves through three 'groupings' the first being the original dispatch to pick up the load, the second where the load is dropped in our drop lot and moved to a different trailer. The third is where the unit is in the customers lot waiting for the customer to unload. The first two groupings are only to display the SLI# and our Order number. The third grouping is supposed to show an aging <when was the load originally picked up> and what trailer is it on. When the customer unloads the trailer, the trailer is supposed to drop off the report.
Below is what I have come up with so far, but I am wondering if I've made this too complicated. I want to group by my finalGrouping formula but am unable too. I've included sample data and my current layout as well as my formulaes so far.
PH SLI# Our# Trailer# Pick Up Date
GH1 RF28357 780054
<Field> LEGID SEQ CITY Trailer PickupDate Carrier Event Status
D 905537 1 SHREVEPORT,LA/ 3798 1/0/1900 12:00:00 AM UNKNOWN BMT DNE
D 905290 2 SHREVEPORT,LA/ 3798 1/18/2007 7:38:00 AM UNKNOWN LLD DNE
D 905538 3 ROMULUS,MI/ 3798 1/0/1900 12:00:00 AM UNKNOWN DLT DNE
D 905539 4 ROMULUS,MI/ 564 1/0/1900 12:00:00 AM les HCT DNE
D 909416 5 SHARON,ON/ 564 1/0/1900 12:00:00 AM les DLT DNE
D 909417 6 SHARON,ON/ 564 1/0/1900 12:00:00 AM les HLT OPN
D 905291 7 MISSISSAUGA,ON/ 564 1/0/1900 12:00:00 AM les LUL OPN
GF1
GH1 RF32304 780057
D 905572 1 HARTSVILLE,SC/ 0087 1/0/1900 12:00:00 AM UNKNOWN BMT DNE
D 905296 2 CROSSVILLE,TN/ 0087 1/18/2007 9:25:00 AM UNKNOWN LLD DNE
D 905574 3 ROMULUS,MI/ 0087 1/0/1900 12:00:00 AM UNKNOWN DLT DNE
D 905575 4 ROMULUS,MI/ 652 1/0/1900 12:00:00 AM les HCT DNE
D 909962 5 SHARON,ON/ 652 1/0/1900 12:00:00 AM les DLT DNE
D 909963 6 SHARON,ON/ 652 1/0/1900 12:00:00 AM les HLT OPN
D 905297 7 MISSISSAUGA,ON/ 652 1/0/1900 12:00:00 AM les LUL OPN
GF1
GH1 RF33028 780064
D 906815 1 INDIANAPOLIS,IN/0013 1/0/1900 12:00:00 AM UNKNOWN BMT DNE
D 905348 2 RUSHVILLE,IN/ 0013 1/19/2007 10:19:00 AM UNKNOWN LLD DNE
D 906817 3 ROMULUS,MI/ 0013 1/0/1900 12:00:00 AM UNKNOWN DLT DNE
D 906818 4 ROMULUS,MI/ UNKNOWN 1/0/1900 12:00:00 AM les HCT OPN
D 905349 5 MISSISSAUGA,ON/ UNKNOWN 1/0/1900 12:00:00 AM les LUL OPN
GF1
GH1 RH09135 781384
D 912243 1 LONGMONT,CO/ 1/0/1900 12:00:00 AM UNKNOWN LLD OPN
D 912244 2 MISSISSAUGA,ON/ 1/0/1900 12:00:00 AM UNKNOWN LUL OPN
GF1
GH1 RH09136 781386
D 912645 1 Tulsa,OK/ 0078 1/0/1900 12:00:00 AM UNKNOWN BMT DNE
D 912245 2 LONGMONT,CO/ 0078 1/0/1900 12:00:00 AM UNKNOWN LLD OPN
D 912649 3 ROMULUS,MI/ 0078 1/0/1900 12:00:00 AM UNKNOWN DLT OPN
D 912650 4 ROMULUS,MI/ UNKNOWN 1/0/1900 12:00:00 AM UNKNOWN HCT OPN
D 912246 5 MISSISSAUGA,ON/ UNKNOWN 1/0/1900 12:00:00 AM UNKNOWN LUL OPN
GF1
I need to insert a group on Final Grouping
Using the data above Order 780054 and 780057 would appear under 3. Woodstock Yard, Order 780064 would appear under 2. Romulus yard and
781384,781386 would be 1. will be coming to romulus. I know how to grab my pickup date and trailer information. It's this final group that has me a bit stumped. If I try to insert a group on @Sort, it just pulls out the associated detail, not the whole order.
My final Result needs to look like this: <Note that the trailer id and shipping date only appear in one group>
I hope this information helps, any assistance in finishing this report off, or even a different approach with the data that may be more efficient would be apprecieated.
Julie
CRXI CE10 / RS2005 Sql DB
This report is a logistics report that is supposed to replace a spreadsheet. The idea behind the report is to track a load from the point it is dispatched until the load is dropped off in the customers drop lot. The unit moves through three 'groupings' the first being the original dispatch to pick up the load, the second where the load is dropped in our drop lot and moved to a different trailer. The third is where the unit is in the customers lot waiting for the customer to unload. The first two groupings are only to display the SLI# and our Order number. The third grouping is supposed to show an aging <when was the load originally picked up> and what trailer is it on. When the customer unloads the trailer, the trailer is supposed to drop off the report.
Below is what I have come up with so far, but I am wondering if I've made this too complicated. I want to group by my finalGrouping formula but am unable too. I've included sample data and my current layout as well as my formulaes so far.
PH SLI# Our# Trailer# Pick Up Date
GH1 RF28357 780054
<Field> LEGID SEQ CITY Trailer PickupDate Carrier Event Status
D 905537 1 SHREVEPORT,LA/ 3798 1/0/1900 12:00:00 AM UNKNOWN BMT DNE
D 905290 2 SHREVEPORT,LA/ 3798 1/18/2007 7:38:00 AM UNKNOWN LLD DNE
D 905538 3 ROMULUS,MI/ 3798 1/0/1900 12:00:00 AM UNKNOWN DLT DNE
D 905539 4 ROMULUS,MI/ 564 1/0/1900 12:00:00 AM les HCT DNE
D 909416 5 SHARON,ON/ 564 1/0/1900 12:00:00 AM les DLT DNE
D 909417 6 SHARON,ON/ 564 1/0/1900 12:00:00 AM les HLT OPN
D 905291 7 MISSISSAUGA,ON/ 564 1/0/1900 12:00:00 AM les LUL OPN
GF1
GH1 RF32304 780057
D 905572 1 HARTSVILLE,SC/ 0087 1/0/1900 12:00:00 AM UNKNOWN BMT DNE
D 905296 2 CROSSVILLE,TN/ 0087 1/18/2007 9:25:00 AM UNKNOWN LLD DNE
D 905574 3 ROMULUS,MI/ 0087 1/0/1900 12:00:00 AM UNKNOWN DLT DNE
D 905575 4 ROMULUS,MI/ 652 1/0/1900 12:00:00 AM les HCT DNE
D 909962 5 SHARON,ON/ 652 1/0/1900 12:00:00 AM les DLT DNE
D 909963 6 SHARON,ON/ 652 1/0/1900 12:00:00 AM les HLT OPN
D 905297 7 MISSISSAUGA,ON/ 652 1/0/1900 12:00:00 AM les LUL OPN
GF1
GH1 RF33028 780064
D 906815 1 INDIANAPOLIS,IN/0013 1/0/1900 12:00:00 AM UNKNOWN BMT DNE
D 905348 2 RUSHVILLE,IN/ 0013 1/19/2007 10:19:00 AM UNKNOWN LLD DNE
D 906817 3 ROMULUS,MI/ 0013 1/0/1900 12:00:00 AM UNKNOWN DLT DNE
D 906818 4 ROMULUS,MI/ UNKNOWN 1/0/1900 12:00:00 AM les HCT OPN
D 905349 5 MISSISSAUGA,ON/ UNKNOWN 1/0/1900 12:00:00 AM les LUL OPN
GF1
GH1 RH09135 781384
D 912243 1 LONGMONT,CO/ 1/0/1900 12:00:00 AM UNKNOWN LLD OPN
D 912244 2 MISSISSAUGA,ON/ 1/0/1900 12:00:00 AM UNKNOWN LUL OPN
GF1
GH1 RH09136 781386
D 912645 1 Tulsa,OK/ 0078 1/0/1900 12:00:00 AM UNKNOWN BMT DNE
D 912245 2 LONGMONT,CO/ 0078 1/0/1900 12:00:00 AM UNKNOWN LLD OPN
D 912649 3 ROMULUS,MI/ 0078 1/0/1900 12:00:00 AM UNKNOWN DLT OPN
D 912650 4 ROMULUS,MI/ UNKNOWN 1/0/1900 12:00:00 AM UNKNOWN HCT OPN
D 912246 5 MISSISSAUGA,ON/ UNKNOWN 1/0/1900 12:00:00 AM UNKNOWN LUL OPN
GF1
Code:
//@Categorize - placed in the detail
if {stops.stp_event} = "LLD" and {stops.stp_status} = "OPN" then "On Way"
Else
if {stops.stp_event} = "LLD" and {stops.stp_status} = "DNE" then "Romulus"
Else
if {stops.stp_event} = "HCT" and {stops.stp_status} = "DNE" then "Woodstock"
//@Sort - placed in the detail
if {@Categorize} = "Romulus" then 2
else
if
{@Categorize} = "Woodstock" then 3
else
if
{@Categorize} = "On Way" then 1
else
0
//@FinalGrouping - placed in GH1
if Sum ({@Sort}, {orderheader.ord_number}) = 5 then "3. Woodstock Yard"
else
if Sum ({@Sort}, {orderheader.ord_number}) = 2 then "2. Romulus Yard"
else
if Sum ({@Sort}, {orderheader.ord_number}) = 1 then "1. Will be Coming to Romulus"
else
"Issues"
//@PickupDate
if {stops.stp_event} = "LLD" and {stops.stp_status} = "DNE" then {stops.stp_arrivaldate}
//@TrailerID
if ({stops.stp_event} = "HCT" or {stops.stp_event} = "HLT") then {stops.trl_id} else " "
I need to insert a group on Final Grouping
Using the data above Order 780054 and 780057 would appear under 3. Woodstock Yard, Order 780064 would appear under 2. Romulus yard and
781384,781386 would be 1. will be coming to romulus. I know how to grab my pickup date and trailer information. It's this final group that has me a bit stumped. If I try to insert a group on @Sort, it just pulls out the associated detail, not the whole order.
My final Result needs to look like this: <Note that the trailer id and shipping date only appear in one group>
Code:
GH2 3. WoodStock Yard
GH1 RF28357 780054 564 1/18/2007
GH1 RF32304 780057 652 1/18/2007
2. Romulus Yard
RF33028 780064
1. Will be coming to Romulus
RH09135 781384
RH09136 781386
Julie
CRXI CE10 / RS2005 Sql DB