Skip to content

Repeat cart adders who never bought

MediumFull bankConditional aggregationFunnelsGroup and aggregate14 min2 hidden datasets

The task

Lifecycle marketing wants to message users who keep putting items in their cart but never check out.

Look only at events with occurred_at from 2025-05-01 (inclusive) up to 2025-07-01 (not included). A user qualifies when, in that period, they fired at least 2 add_to_cart events and no purchase event.

Return:

  • user_id
  • platform: from users
  • cart_adds: how many add_to_cart events the user fired in the period
  • last_cart_at: the time of their latest add_to_cart event in the period

Sort by cart_adds descending, then user_id ascending.

Expected output

user_idplatformcart_addslast_cart_at
  • Sorted by cart_adds descending, then user_id ascending.
  • Checked on the sample and on 2 hidden datasets. How grading works

Tables Mobile shopping app · click a name to insert it

users360 rows in the sample

One row per user. Key: user_id.

intUnique id.
timestampSign-up time (UTC).
textTwo-letter country code.
textios, android or web.
textorganic, paid, referral or partner. NULL when unknown.
events7,616 rows in the sample

One row per tracked event. Key: event_id.

bigintUnique id.
intWho fired it.
textapp_open, search, view_item, add_to_cart, begin_checkout, purchase or share.
timestampWhen (UTC).
textSession the event belongs to. NULL for a few events sent from the background.
numeric(10,2)Order value for purchase events, NULL otherwise.
experiment_assignments349 rows in the sample

Which variant each user saw in each experiment. Key: user_id, experiment.

intThe user.
textnew_onboarding or one_tap_checkout.
textcontrol or treatment.
timestampWhen the user was assigned (UTC).

Related questions

Loading the editor and PostgreSQL