Marketplace Seller Analytics Path · Mission 6 of 25Medium

Orders by marketplace × month (last 12 months)

First multi-key GROUP BY with date manipulation. Practice substring-based month extraction (substr(text, 1, 7)), grouping by two columns, and producing a long-format time series the BI team can pivot into a chart.

Back to Marketplace Seller Analytics

The Brief

Devon ParkBI Leadmarketplace-ops

Monthly seller report. Pull orders by (month, marketplace_name) for the last 12 months (order_ts >= '2025-04-01'). Three columns: month (substr(order_ts, 1, 7) = YYYY-MM), marketplace_name, orders (COUNT). Sort month ASC, marketplace_name ASC. The chart team pivots this in Looker — long format is what they want.

You'll practice

date_truncGROUP BY multi-keyPivot-style

Tables & columns available

fact_ordersfact7 columns
ColumnTypeKey
order_idINTPK
listing_idINTFK → dim_listings
marketplace_idINTFK → dim_marketplaces
order_tsTEXT
unitsINT
gross_amountREAL
refundedINT
dim_marketplacesdim4 columns
ColumnTypeKey
marketplace_idINTPK
marketplace_nameTEXT
marketplace_fee_pctREAL
fba_supportedINT

Hints (4)

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

Hint 1

substr(order_ts, 1, 7) gives 'YYYY-MM' from a TEXT order_ts of 'YYYY-MM-DD HH:MM:SS'.

Hint 2

JOIN dim_marketplaces for the human-readable name.

Hint 3

Filter order_ts >= '2025-04-01'.

Hint 4

GROUP BY substr(order_ts, 1, 7), marketplace_name. Both keys needed.