Skip to content

Commit

Permalink
fixing a bug in the backfill
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Timoteo committed Dec 18, 2024
1 parent ec8bc04 commit 3c9a954
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sql/query/invoke_backfill_lead_score_propensity_label.sqlx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ CREATE OR REPLACE TEMP TABLE future_logins_per_user AS (
input_date as feature_date,
-- This calculation is performed over a window partitioned by user_pseudo_id and input_date
-- Repeats the above logic for different day offsets (1) to calculate future login counts for different days
MAX(COUNT(DISTINCT CASE DATE_DIFF(event_date, input_date, DAY) = 1 WHEN TRUE THEN ecommerce.transaction_id END)) OVER(PARTITION BY user_pseudo_id, input_date) AS purchase_day_1
MAX(COUNT(DISTINCT CASE DATE_DIFF(event_date, input_date, DAY) = 1 WHEN TRUE THEN ecommerce.transaction_id END)) OVER(PARTITION BY user_pseudo_id, input_date) AS login_day_1
FROM `{{mds_project_id}}.{{mds_dataset}}.event` as E
INNER JOIN `{{mds_project_id}}.{{mds_dataset}}.device` as D
ON E.device_type_id = D.device_type_id
Expand Down

0 comments on commit 3c9a954

Please sign in to comment.