Crystal 9
I'm writing a report using a single order table. An order is placed and assigned a unique order number. That order may later be cancelled (same order number) and replaced (new order number) when something is adjusted. I now have three line items for the same order. My goal is to eliminate the line for the original and the cancel and only keep the replacement in those situations. Sounds easy enough but I'm stuck and would appreciate an assist. Here is what my data basically looks like:
Order# Qty Px Cancel Rebill Prod# B/S Comm As/Of
12345 100,000 101 99999 S $50 1/5/11
12346 250,000 100 88888 B $75 2/1/11
12346 250,000 100 1 88888 B $75 2/1/11
12347 250,000 100 1 88888 B $80 2/1/11
12348 90,000 99 99999 B $45 3/15/11
12349 80,000 102 77777 S $99 4/1/11
12349 80,000 102 1 77777 S $99 4/1/11
12350 80,000 103 1 77777 S $99 4/1/11
12351 400,000 98 88888 S $250 5/15/11
This is my desired outcome based on the above sample. . .
Order# Qty Px Cancel Rebill Prod# B/S Comm As/Of
12345 100,000 101 99999 S $50 1/5/11
12347 250,000 100 1 88888 B $80 2/1/11
12348 90,000 99 99999 B $45 3/15/11
12350 80,000 103 1 77777 S $99 4/1/11
12351 400,000 98 88888 S $250 5/15/11
Essentially, I need to get rid of the line item with a cancel indicator of "1" and also the original line item that has the same order number. I will now be left with just the line item with a rebill indicator of "1" and those records that were never cancelled.
Please advise and thank you.
I'm writing a report using a single order table. An order is placed and assigned a unique order number. That order may later be cancelled (same order number) and replaced (new order number) when something is adjusted. I now have three line items for the same order. My goal is to eliminate the line for the original and the cancel and only keep the replacement in those situations. Sounds easy enough but I'm stuck and would appreciate an assist. Here is what my data basically looks like:
Order# Qty Px Cancel Rebill Prod# B/S Comm As/Of
12345 100,000 101 99999 S $50 1/5/11
12346 250,000 100 88888 B $75 2/1/11
12346 250,000 100 1 88888 B $75 2/1/11
12347 250,000 100 1 88888 B $80 2/1/11
12348 90,000 99 99999 B $45 3/15/11
12349 80,000 102 77777 S $99 4/1/11
12349 80,000 102 1 77777 S $99 4/1/11
12350 80,000 103 1 77777 S $99 4/1/11
12351 400,000 98 88888 S $250 5/15/11
This is my desired outcome based on the above sample. . .
Order# Qty Px Cancel Rebill Prod# B/S Comm As/Of
12345 100,000 101 99999 S $50 1/5/11
12347 250,000 100 1 88888 B $80 2/1/11
12348 90,000 99 99999 B $45 3/15/11
12350 80,000 103 1 77777 S $99 4/1/11
12351 400,000 98 88888 S $250 5/15/11
Essentially, I need to get rid of the line item with a cancel indicator of "1" and also the original line item that has the same order number. I will now be left with just the line item with a rebill indicator of "1" and those records that were never cancelled.
Please advise and thank you.