Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit 4f76a21

Browse files
Dan Leedataform.co
authored andcommitted
swap timestamps in session_index lag
1 parent 9262949 commit 4f76a21

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

includes/sessionized_events.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,16 @@ select
5050
*,
5151
coalesce(
5252
(
53-
${crossdb.timestampDiff(`millisecond`, `segment_events_mapped.timestamp`,
53+
${crossdb.timestampDiff(`millisecond`,
5454
crossdb.windowFunction({
5555
func: "lag",
5656
value: "timestamp",
5757
ignore_nulls: false,
5858
partition_fields: "user_id",
5959
order_fields: "timestamp asc",
6060
frame_clause: " " // supplying empty frame clause as frame clause is not valid for a lag
61-
})
61+
}),
62+
`segment_events_mapped.timestamp`
6263
)}
6364
) >= ${params.sessionTimeoutMillis},
6465
true

0 commit comments

Comments
 (0)