0
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()
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

1 Answers1

0

Use the Multi-Row Formula tool to get equivalent of LAG function. If the column name is col1, then the equivalent expression to be used in the Multi-Row Formula to access previous row's data is [Row-1:col1]

Madhukar
  • 1,194
  • 1
  • 13
  • 29