Finance Path · Mission 22 of 25Expert

New vs. recurring vendor spend

Per-group FIRST_VALUE / MIN subquery to classify entities

Back to Finance

The Brief

Sam PatelTreasury Analysttreasury

For the vendor rationalization review — for every vendor with 2025 posted spend, classify them as 'new' (their first-ever txn is in 2025) or 'recurring' (earlier history). Columns: `vendor_name`, `total_spend_2025`, `vendor_status`.

You'll practice

CTECohort logicFirst-seen

Tables available

fact_transactionsdim_vendors

Hints (3)

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

Hint 1

First compute each vendor's earliest txn year: `MIN(EXTRACT(YEAR FROM txn_date::date))` grouped by vendor_id.

Hint 2

Join that back to 2025 spend per vendor (posted only).

Hint 3

CASE WHEN first_year = 2025 THEN 'new' ELSE 'recurring' END.