I get this error when I try to subtract the timestamps and do a window function (lead, lag and partition by):
Invalid argument types for function '-': (TIMESTAMP_NTZ(9), TIMESTAMP_NTZ(9))
Tried date_diff, but that doesn't work along with window function
SELECT
user_id,
event,
received_at,
received_at - LAG( received_at,1) OVER (PARTITION BY user_id ORDER BY received_at) AS last_event
FROM
segment_javascript.help_center_opened