I need to know a function that calculates row 1 and row 2

I need to know a function that calculates row 1 and row 2.
Do you have a method?

If that is a baq that supports SQL partition and window calling you can try something like:

SUM(PartMTL.Qtyper * part.Batch_c)
OVER (
PARTITION BY MyTable.SomeKey
ORDER BY MyTable.SysRowID
ROWS BETWEEN 2 PRECEDING AND CURRENT ROW
)

Partition by needs a subgrouping so try set this to Parent_part and I think, if the BAQ allows it, get you the result. The above is a single line clause in sql

4 Likes

This translates to “make it an expression in a calculated field in the BAQ.” The OVER Partition By pattern works well.

4 Likes

Thank you

Thank you :grinning_face_with_smiling_eyes: