CASE
WHEN SUBSTR("LotId", 1, 13) =
SUBSTR(LAG("LotId") OVER(ORDER BY "LotId"), 1, 13) AND
SPUTTER_OpCT IS NULL THEN
COALESCE(LAG(SPUTTER_OpCT) OVER(ORDER BY "LotId"),
LAG(SPUTTER_OpCT, 2) OVER(ORDER BY "LotId"),
LAG(SPUTTER_OpCT, 3) OVER(ORDER BY "LotId"))
ELSE
SPUTTER_OpCT
END AS "SPUTTER_OpCT",