AML & Fraud Analytics Path · Mission 4 of 30Starter

Drop the reversals

WHERE + COUNT to exclude data-quality noise from a volume count

Back to AML & Fraud Analytics

The Brief

Lena ParkTransaction Monitoring Leadaml-ops

Our January+February volume report is off. The raw row count from `aml_transactions` includes reversals — when the original wire gets recalled or the cash deposit gets re-booked, the reversing row has `is_reversal = 1` and cancels out the money move, but it still bumps the row count. Give me the count of transactions where `is_reversal = 0`. That's the number we'd actually show the board. Single number.

You'll practice

WHERESUMData quality

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

The column `is_reversal` is 0 or 1. Filter it in WHERE — don't use `NOT NULL`, the column isn't nullable.

Hint 2

COUNT(*) on aml_transactions filtered to non-reversals — single row, single column.

Hint 3

If you ever return this kind of count to compliance, pair it with the reversal count separately — that's how you prove the discrepancy explains the gap, not a missing load.