AML & Fraud Analytics Path · Mission 7 of 30Easy

Daily deposit count per account

GROUP BY a composite key + HAVING to find same-day burst activity

Back to AML & Fraud Analytics

The Brief

Lena ParkTransaction Monitoring Leadaml-ops

Different angle from Teresa's question. I don't care about the monthly structuring signal right now — I want to know which accounts took in 2 or more cash deposits on the same day. Same-day burst is its own typology (the cash came in from one bag split across multiple deposit envelopes). Return account_id, posted_date, and the deposit count, for any (account, day) pair with at least 2 cash deposits. Exclude reversals. Order by count desc then account asc.

You'll practice

COUNTDATE_TRUNCGROUP BY

Tables & columns available

aml_transactionsfact9 columns
ColumnTypeKey
txn_idINTPK
account_idINTFK → aml_accounts
posted_dateTEXT
posted_tsTEXT
amountREAL
channelTEXT
counterparty_nameTEXT
counterparty_account_idINT
is_reversalINT

Hints (3)

Each hint you reveal reduces the XP you can earn. Try the query first.

Hint 1

Group by BOTH `account_id` and `posted_date`. The pair is the grain — a single account gets one row per day.

Hint 2

Filter `channel = 'cash_deposit'` and `is_reversal = 0`. HAVING `COUNT(*) >= 2`.

Hint 3

Each output row is one (account, day) where the cash-deposit count met the gate. Order DESC by count if you want the worst bursts on top.