SELECT
*,
LAG(orderdate, 1, NULL) OVER (PARTITION BY fullaccountnum, cin ORDER BY orderdate) AS previous_orderdate
FROM
table.revenue_invoice_data
I've tried the expression below in the formula tool to no avail. I keep getting the error: syntax or semantic error analysis.
fullaccountnum == [fullaccountnum-1] &&
cin == [cin-1] ? [orderdate-1] : Null()