Assign Misc Charges only to the first line of Shipment

Hello everyone,

I am creating a report in BAQ that shows sales based on shipment.
This BAQ’s head is Packing Slip (Shipment No.). Misc Charges is from OrderHed.
However, by doing this, Misc Charges were allocated to all lines of Shipment, resulting in a strange amount.
Can’t I make Misc Charges only assigned to the first line of a Shipment?
Please help. Thanks in advance!

I can’t see what you have in your BAQ but my guess is that there’s nothing wrong with your sales order - it’s the way you designed the BAQ that’s causing this.

You can use the line misc charges instead of the header one - instead of going New → New Header Misc Charge, use New → New Line Misc Charge

1 Like

Thanks for your reply. But, these Misc charges are costs incurred on the header, not on the line. Typically they are shipping or handling charges. These costs are charged to the entire shipment, not to each line. ㄴSo I unfortunately can’t use Line Misc Charge.

OK, first you’ll need a calculated field to re-number the pack lines in case you have packs with line 1 deleted. Then another calculated field to show the charge only if line no is 1:

LineNo = ROW_NUMBER() OVER(PARTITION BY ShipDtl.Company, ShipDtl.PackNum ORDER BY ShipDtl.Company, ShipDtl.PackNum, ShipDtl.PackLine)

MiscCharges = case when LineNo=1 then OrderHed.DocTotalMisc else 0 end

Thanks for the great tip!
I completely solved this issue with the tips you gave me.