Robert Vice
05/24/2023, 1:54 PMSELECT T.id, T.transferlocation, TL.location, BUILTIN.DF(TL.item) as ITEM, TL.quantity, TL.quantityshiprecv from transaction as T INNER JOIN transactionline as TL ON TL.transaction = T.id WHERE T.type ='TrnfrOrd' AND (TL.quantity - TL.quantityshiprecv) > 0
I confirmed on the IF's and the TO that the transferlocation and location are different.
inventorylocation is also the same
T.location doesn't work, even though it's in the analytics workbook. Gives a reason, REMOVED - Field is removedClay Roper
05/24/2023, 2:24 PMtransactionline.inventoryreportinglocation
- when combined with quantity, that should show you where it moves from (negative quantity) and to (positive quantity).
You'll need to find a way to remove duplicate lines though, which I'm looking into now.Robert Vice
05/24/2023, 2:25 PMinventoryreportinglocation
gives the same location as the othersClay Roper
05/24/2023, 2:27 PMtransactionlinetype
value of "ITEM", so those can be discarded.Robert Vice
05/24/2023, 2:27 PMRobert Vice
05/24/2023, 2:28 PM(TL.quantity - TL.quantityshiprecv) > 0
Clay Roper
05/24/2023, 2:44 PMABS(TL.quantity) - TL.quantityshiprecv > 0
Edited to fix parenthesis placementClay Roper
05/24/2023, 2:45 PMClay Roper
05/24/2023, 2:46 PMtransferorderitemlineid IS NOT NULL
I'd like to figure out how to filter by transactionlinetype
, but even though the records catalog claims it's a string, there's something funky happening under the hood like transaction statuses. Using WHERE transactionlinetype != 'ITEM'
returns lines with transactionlinetype = 'ITEM'
...Robert Vice
05/24/2023, 2:52 PMRobert Vice
05/24/2023, 2:52 PMSELECT T.id, T.transferlocation, TL.inventoryreportinglocation, TL.location, BUILTIN.DF(TL.item) as ITEM, TL.quantity, TL.quantityshiprecv from transaction as T INNER JOIN transactionline as TL ON TL.transaction = T.id WHERE T.type ='TrnfrOrd' AND (ABS(TL.quantity) - TL.quantityshiprecv) > 0
I get more results, but locations are all the sameClay Roper
05/24/2023, 3:01 PMWHERE ... ABS(TL.quantity) != TL.quantityshiprecv
?Robert Vice
05/24/2023, 3:02 PMRobert Vice
05/24/2023, 3:02 PMClay Roper
05/24/2023, 3:17 PMtransferorderitemlineid IS NOT NULL
should help with thatClay Roper
05/24/2023, 3:21 PMWHERE ... BUILTIN.DF(transactionlinetype) IN ('Transfer Order: Shipping', 'Transfer Order: Receiving')