Skip to content

Customer activation funnel by segment

EasyFreeFunnelsJoinsRatios and percentages10 min2 hidden datasets

The task

The bank tracks how many new customers become active. The funnel has three steps:

  1. customers: every customer in customers
  2. with_account: customers who own at least one row in accounts
  3. with_transaction: customers with at least one row in transactions on any of their accounts

A customer with three accounts or four hundred transactions still counts once.

Return one row per segment:

  • segment
  • customers
  • with_account
  • with_transaction
  • activation_rate: with_transaction as a percentage of customers, rounded to 1 decimal place

Sort by segment.

Expected output

segmentcustomerswith_accountwith_transactionactivation_rate
  • Sorted by segment ascending.
  • Numbers rounded to 1 decimal place.
  • Checked on the sample and on 2 hidden datasets. How grading works

Tables Digital bank · click a name to insert it

customers70 rows in the sample

One row per customer. Key: customer_id.

intUnique id.
textName.
dateDay they became a customer.
textretail, premium or business.
accounts126 rows in the sample

One row per account. A customer can have several. Key: account_id.

intUnique id.
intOwner.
textchecking, savings or credit.
dateOpening day.
dateClosing day. NULL while open.
transactions9,906 rows in the sample

One row per posted transaction. Positive amounts are money in, negative are money out. Key: txn_id.

bigintUnique id.
intThe account.
timestampWhen it posted (UTC).
numeric(12,2)Signed amount, USD.
textsalary, rent, groceries, dining, travel, transfer, fees or refund.
textMerchant name. NULL for salary, transfers and fees.

Related questions

Loading the editor and PostgreSQL