Continuing the discussion from Error on Running Total: Part Tran History:
Hi all, I wanted to recreate the part transaction history report into a BAQ and have taken all of your input into account and used your suggestions. However it is calculating the incorrect running total compared to the Part Transaction History Tracker.
I have the calculated signed total as:
(case
when PartTran.TranType IN (‘STK-ASM’, ‘STK-CUS’,‘STK-STK’, ‘STK-INS’, ‘STK-KIT’, ‘STK-FAM’, ‘STK-MTL’, ‘STK-PLT’, ‘STK-UKN’, ‘STK-DMR’) then -1
when PartTran.TranType IN (‘ADJ-CST’, ‘ADJ-QTY’, ‘AST-STK’, ‘DMR-STK’, ‘INS-STK’, ‘MFG-STK’, ‘PLT-STK’, ‘PUR-STK’, ‘STK-STK’, ‘SVG-STK’) then 1
else 0
end) * PartTran.TranQty
and my sum of running total as:
SUM(RunningTotal) OVER (PARTITION BY PartTran.PartNum ORDER BY PartTran.TranNum)
In the tracker I have this amount:
But in my BAQ I have this amount:
What can I be doing to begin to check why this may be wrong? The number of records returned by both are the same so I assume it may be the TranTypes that may be messing it up. Any thoughts?