Skip to content

Commit ced7e47

Browse files
committed
add date ranges
1 parent 6ac1a67 commit ced7e47

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

tinybird/pipes/auth0_daily_login_fails.pipe

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ TAGS "auth0"
44

55
NODE ep
66
SQL >
7-
7+
%
88
SELECT toDate(toStartOfDay(event_time)) as day, count() as fails
99
FROM auth0
10-
where event_type == 'f' and event_time >= now() - interval 30 days
10+
where event_type == 'f'
11+
AND event_time >= {{DateTime(date_from, '2024-01-01 00:00:00')}}
12+
AND event_time <= {{DateTime(date_to, '2024-12-31 23:59:59')}}
1113
group by day
1214
order by day asc
1315

tinybird/pipes/auth0_daily_signups.pipe

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ TAGS "auth0"
44

55
NODE ep
66
SQL >
7-
7+
%
88
SELECT toDate(toStartOfDay(event_time)) as day, count() as signups
99
FROM auth0
10-
WHERE event_type = 'ss' and event_time >= now() - interval 30 days
10+
WHERE event_type = 'ss'
11+
AND event_time >= {{DateTime(date_from, '2024-01-01 00:00:00')}}
12+
AND event_time <= {{DateTime(date_to, '2024-12-31 23:59:59')}}
1113
GROUP BY day
1214
order by day asc
1315

tinybird/pipes/auth0_dau_ts.pipe

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ TAGS "auth0"
44

55
NODE ep
66
SQL >
7-
7+
%
88
SELECT toStartOfDay(event_time)::Date as day, count(DISTINCT event.data.user_id) as active
99
FROM auth0
10-
where event_type == 's' and event_time >= now() - interval 30 days
11-
group by day
12-
order by day
10+
WHERE event_type == 's'
11+
AND event_time >= {{DateTime(date_from, '2024-01-01 00:00:00')}}
12+
AND event_time <= {{DateTime(date_to, '2024-12-31 23:59:59')}}
13+
GROUP BY day
14+
ORDER BY day
1315

1416

tinybird/pipes/auth0_mech_usage.pipe

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ TAGS "auth0"
44

55
NODE ep
66
SQL >
7-
7+
%
88
SELECT splitByChar('|', event.data.user_id::String)[1] as mech, count() as logins
99
FROM auth0
10-
where event_type == 's' and event_time >= now() - interval 30 days
10+
where event_type == 's'
11+
AND event_time >= {{DateTime(date_from, '2024-01-01 00:00:00')}}
12+
AND event_time <= {{DateTime(date_to, '2024-12-31 23:59:59')}}
1113
group by mech
1214
order by logins desc
1315

0 commit comments

Comments
 (0)