Dealer churn: find dealers who stopped ordering.
Two saved queries read from your order lines what dealers never say: who stopped ordering, and how long new dealers take to their first sale. Spark SQL over tables you own, on a Kubernetes cluster you operate.
41 order lines.
None for 221 days.
Order lines of DLR-0152 and the 11 other dealers longest without one, 28 Nov 2025 to 27 Nov 2026
DLR-0185
DLR-0158
DLR-0064
DLR-0053
DLR-0193
DLR-0147
DLR-0152
DLR-0047
DLR-0015
DLR-0032
DLR-0042
DLR-0062
The inactive dealer report in Spark SQL
A dealer who stops ordering rarely says so, the order lines do. The Inactive Dealer Report lists an active dealer once its last sale is more than 180 days old.
DLR-0185
- region
- WEST
- onboarded_date
- 27 Mar 2021
- order lines in the year
- 1
- last_sale_date
- 3 Dec 2025
- days_since_last_sale
- 359
- longest silence
- 359 days, 3 Dec 2025 to 27 Nov 2026
activity_status todayAt Risk (6-12 months)so the report lists it
with the line at 180 days: listed 179 days this year, 2 Jun 2026 to 27 Nov 2026
with the line at 90 days: listed 269 days this year, 4 Mar 2026 to 27 Nov 2026
with the line at 60 days: listed 299 days this year, 2 Feb 2026 to 27 Nov 2026
with the line at 45 days: listed 314 days this year, 18 Jan 2026 to 27 Nov 2026
- listed At Risk since 2 Jun 2026
- Dormant from 4 Dec 2026 if no order comes
DLR-0158
- region
- WEST
- onboarded_date
- 25 May 2022
- order lines in the year
- 7
- last_sale_date
- 3 Jan 2026
- days_since_last_sale
- 328
- longest silence
- 328 days, 3 Jan 2026 to 27 Nov 2026
activity_status todayAt Risk (6-12 months)so the report lists it
with the line at 180 days: listed 148 days this year, 3 Jul 2026 to 27 Nov 2026
with the line at 90 days: listed 238 days this year, 4 Apr 2026 to 27 Nov 2026
with the line at 60 days: listed 268 days this year, 5 Mar 2026 to 27 Nov 2026
with the line at 45 days: listed 283 days this year, 18 Feb 2026 to 27 Nov 2026
- listed At Risk since 3 Jul 2026
- Dormant from 4 Jan 2027 if no order comes
DLR-0064
- region
- NORTHEAST
- onboarded_date
- 26 Feb 2021
- order lines in the year
- 2
- last_sale_date
- 4 Jan 2026
- days_since_last_sale
- 327
- longest silence
- 327 days, 4 Jan 2026 to 27 Nov 2026
activity_status todayAt Risk (6-12 months)so the report lists it
with the line at 180 days: listed 147 days this year, 4 Jul 2026 to 27 Nov 2026
with the line at 90 days: listed 237 days this year, 5 Apr 2026 to 27 Nov 2026
with the line at 60 days: listed 267 days this year, 6 Mar 2026 to 27 Nov 2026
with the line at 45 days: listed 282 days this year, 19 Feb 2026 to 27 Nov 2026
- listed At Risk since 4 Jul 2026
- Dormant from 5 Jan 2027 if no order comes
DLR-0053
- region
- MIDWEST
- onboarded_date
- 19 May 2020
- order lines in the year
- 1
- last_sale_date
- 12 Jan 2026
- days_since_last_sale
- 319
- longest silence
- 319 days, 12 Jan 2026 to 27 Nov 2026
activity_status todayAt Risk (6-12 months)so the report lists it
with the line at 180 days: listed 139 days this year, 12 Jul 2026 to 27 Nov 2026
with the line at 90 days: listed 229 days this year, 13 Apr 2026 to 27 Nov 2026
with the line at 60 days: listed 259 days this year, 14 Mar 2026 to 27 Nov 2026
with the line at 45 days: listed 274 days this year, 27 Feb 2026 to 27 Nov 2026
- listed At Risk since 12 Jul 2026
- Dormant from 13 Jan 2027 if no order comes
DLR-0193
- region
- MIDWEST
- onboarded_date
- 1 Jul 2015
- order lines in the year
- 4
- last_sale_date
- 17 Jan 2026
- days_since_last_sale
- 314
- longest silence
- 314 days, 17 Jan 2026 to 27 Nov 2026
activity_status todayAt Risk (6-12 months)so the report lists it
with the line at 180 days: listed 134 days this year, 17 Jul 2026 to 27 Nov 2026
with the line at 90 days: listed 224 days this year, 18 Apr 2026 to 27 Nov 2026
with the line at 60 days: listed 254 days this year, 19 Mar 2026 to 27 Nov 2026
with the line at 45 days: listed 269 days this year, 4 Mar 2026 to 27 Nov 2026
- listed At Risk since 17 Jul 2026
- Dormant from 18 Jan 2027 if no order comes
DLR-0147
- region
- NORTHEAST
- onboarded_date
- 16 Jan 2017
- order lines in the year
- 16
- last_sale_date
- 31 Jan 2026
- days_since_last_sale
- 300
- longest silence
- 300 days, 31 Jan 2026 to 27 Nov 2026
activity_status todayAt Risk (6-12 months)so the report lists it
with the line at 180 days: listed 120 days this year, 31 Jul 2026 to 27 Nov 2026
with the line at 90 days: listed 210 days this year, 2 May 2026 to 27 Nov 2026
with the line at 60 days: listed 240 days this year, 2 Apr 2026 to 27 Nov 2026
with the line at 45 days: listed 255 days this year, 18 Mar 2026 to 27 Nov 2026
- listed At Risk since 31 Jul 2026
- Dormant from 1 Feb 2027 if no order comes
DLR-0152
- region
- WEST
- onboarded_date
- 23 Mar 2019
- order lines in the year
- 41
- last_sale_date
- 20 Apr 2026
- days_since_last_sale
- 221
- longest silence
- 221 days, 20 Apr 2026 to 27 Nov 2026
activity_status todayAt Risk (6-12 months)so the report lists it
with the line at 180 days: listed 41 days this year, 18 Oct 2026 to 27 Nov 2026
with the line at 90 days: listed 131 days this year, 20 Jul 2026 to 27 Nov 2026
with the line at 60 days: listed 161 days this year, 20 Jun 2026 to 27 Nov 2026
with the line at 45 days: listed 176 days this year, 5 Jun 2026 to 27 Nov 2026
- listed At Risk since 18 Oct 2026
- Dormant from 21 Apr 2027 if no order comes
DLR-0047
- region
- NORTHEAST
- onboarded_date
- 27 Mar 2018
- order lines in the year
- 11
- last_sale_date
- 24 Apr 2026
- days_since_last_sale
- 217
- longest silence
- 217 days, 24 Apr 2026 to 27 Nov 2026
activity_status todayAt Risk (6-12 months)so the report lists it
with the line at 180 days: listed 37 days this year, 22 Oct 2026 to 27 Nov 2026
with the line at 90 days: listed 127 days this year, 24 Jul 2026 to 27 Nov 2026
with the line at 60 days: listed 157 days this year, 24 Jun 2026 to 27 Nov 2026
with the line at 45 days: listed 187 days this year, 9 Apr 2026 to 23 Apr 2026, 9 Jun 2026 to 27 Nov 2026
- listed At Risk since 22 Oct 2026
- Dormant from 25 Apr 2027 if no order comes
DLR-0015
- region
- NORTHEAST
- onboarded_date
- 6 Apr 2022
- order lines in the year
- 25
- last_sale_date
- 25 Apr 2026
- days_since_last_sale
- 216
- longest silence
- 216 days, 25 Apr 2026 to 27 Nov 2026
activity_status todayAt Risk (6-12 months)so the report lists it
with the line at 180 days: listed 36 days this year, 23 Oct 2026 to 27 Nov 2026
with the line at 90 days: listed 126 days this year, 25 Jul 2026 to 27 Nov 2026
with the line at 60 days: listed 156 days this year, 25 Jun 2026 to 27 Nov 2026
with the line at 45 days: listed 171 days this year, 10 Jun 2026 to 27 Nov 2026
- listed At Risk since 23 Oct 2026
- Dormant from 26 Apr 2027 if no order comes
DLR-0032
- region
- SOUTHWEST
- onboarded_date
- 9 Aug 2016
- order lines in the year
- 25
- last_sale_date
- 1 May 2026
- days_since_last_sale
- 210
- longest silence
- 210 days, 1 May 2026 to 27 Nov 2026
activity_status todayAt Risk (6-12 months)so the report lists it
with the line at 180 days: listed 30 days this year, 29 Oct 2026 to 27 Nov 2026
with the line at 90 days: listed 120 days this year, 31 Jul 2026 to 27 Nov 2026
with the line at 60 days: listed 150 days this year, 1 Jul 2026 to 27 Nov 2026
with the line at 45 days: listed 165 days this year, 16 Jun 2026 to 27 Nov 2026
- listed At Risk since 29 Oct 2026
- Dormant from 2 May 2027 if no order comes
DLR-0042
- region
- MIDWEST
- onboarded_date
- 7 Nov 2023
- order lines in the year
- 30
- last_sale_date
- 11 Aug 2026
- days_since_last_sale
- 108
- longest silence
- 108 days, 11 Aug 2026 to 27 Nov 2026
activity_status todayActiveActive, so the report leaves it out
with the line at 180 days: never listed this year
with the line at 90 days: listed 18 days this year, 10 Nov 2026 to 27 Nov 2026
with the line at 60 days: listed 48 days this year, 11 Oct 2026 to 27 Nov 2026
with the line at 45 days: listed 63 days this year, 26 Sep 2026 to 27 Nov 2026
- listed At Risk from 8 Feb 2027 if no order comes
- Dormant from 12 Aug 2027 if no order comes
DLR-0062
- region
- WEST
- onboarded_date
- 8 Apr 2020
- order lines in the year
- 10
- last_sale_date
- 1 Sep 2026
- days_since_last_sale
- 87
- longest silence
- 87 days, 1 Sep 2026 to 27 Nov 2026
activity_status todayActiveActive, so the report leaves it out
with the line at 180 days: never listed this year
with the line at 90 days: never listed this year
with the line at 60 days: listed 27 days this year, 1 Nov 2026 to 27 Nov 2026
with the line at 45 days: listed 42 days this year, 17 Oct 2026 to 27 Nov 2026
- listed At Risk from 1 Mar 2027 if no order comes
- Dormant from 2 Sep 2027 if no order comes
On 27 Nov 2026 the report lists 10 of these twelve dealers.
The queries and the tables
-- name: Retail Distribution/Operations/Inactive Dealer Report
-- engine: SPARK_SQL
-- maxRows: 1000
WITH last_activity AS (
SELECT
s.dealer_id,
MAX(s.transaction_date) AS last_sale_date,
COUNT(*) AS lifetime_orders,
ROUND(SUM(s.total_price_usd), 2) AS lifetime_revenue_usd
FROM retail_distribution.sales_transactions s
GROUP BY s.dealer_id
)
SELECT
d.dealer_id,
d.region,
d.onboarded_date,
d.years_as_partner,
la.last_sale_date,
DATEDIFF(current_date(), la.last_sale_date) AS days_since_last_sale,
COALESCE(la.lifetime_orders, 0) AS lifetime_orders,
COALESCE(la.lifetime_revenue_usd, 0) AS lifetime_revenue_usd,
CASE
WHEN la.last_sale_date IS NULL THEN 'Never Sold'
WHEN DATEDIFF(current_date(), la.last_sale_date) > 365 THEN 'Dormant (>12 months)'
WHEN DATEDIFF(current_date(), la.last_sale_date) > 180 THEN 'At Risk (6-12 months)'
ELSE 'Active'
END AS activity_status
FROM retail_distribution.dealers d
LEFT JOIN last_activity la ON d.dealer_id = la.dealer_id
WHERE d.active = true
AND (la.last_sale_date IS NULL OR la.last_sale_date < date_sub(current_date(), 180))
ORDER BY days_since_last_sale DESC NULLS FIRST
-- name: Retail Distribution/Operations/Dealer Onboarding Pipeline
-- engine: SPARK_SQL
-- maxRows: 1000
-- description: New dealers onboarded by quarter and region with time-to-first-sale analysis
WITH quarterly_onboarding AS (
SELECT
d.region,
YEAR(d.onboarded_date) AS onboard_year,
QUARTER(d.onboarded_date) AS onboard_quarter,
d.dealer_id,
d.onboarded_date
FROM retail_distribution.dealers d
WHERE d.onboarded_date >= date_sub(current_date(), 730)
),
first_sale AS (
SELECT
s.dealer_id,
MIN(s.transaction_date) AS first_sale_date
FROM retail_distribution.sales_transactions s
GROUP BY s.dealer_id
)
SELECT
qo.region,
qo.onboard_year,
qo.onboard_quarter,
COUNT(*) AS dealers_onboarded,
COUNT(fs.first_sale_date) AS dealers_with_sales,
ROUND(COUNT(fs.first_sale_date) * 100.0 / COUNT(*), 1) AS activation_rate_pct,
ROUND(AVG(DATEDIFF(fs.first_sale_date, qo.onboarded_date)), 0) AS avg_days_to_first_sale,
MIN(DATEDIFF(fs.first_sale_date, qo.onboarded_date)) AS min_days_to_first_sale,
MAX(DATEDIFF(fs.first_sale_date, qo.onboarded_date)) AS max_days_to_first_sale
FROM quarterly_onboarding qo
LEFT JOIN first_sale fs ON qo.dealer_id = fs.dealer_id
GROUP BY qo.region, qo.onboard_year, qo.onboard_quarter
ORDER BY qo.onboard_year DESC, qo.onboard_quarter DESC, qo.region
retail_distribution.dealersDealer dimension table. One row per authorized dealer in the distribution network.dealer_id | Unique dealer identifier (format: DLR-XXXX) |
|---|---|
region | Sales region assignment |
years_as_partner | Number of years as an authorized dealer |
active | Whether dealer is currently active in the network |
onboarded_date | Date dealer was onboarded to the network |
retail_distribution.sales_transactionsSales transaction fact table. All product orders placed through the dealer network. One row per line item.transaction_id | The order line |
|---|---|
dealer_id | FK to dealers table |
transaction_date | Date the order was placed |
quantity | Number of units ordered |
total_price_usd | Total order value (quantity x unit_price_usd, after discount) |
order_source | Channel through which the order was placed: DEALER_PORTAL, PHONE, TRADE_SHOW, REFERRAL |
| Status | Days since the last sale |
|---|---|
| Never Sold | no sale at all |
| Dormant (>12 months) | more than 365 |
| At Risk (6-12 months) | more than 180 |
| Active | 180 or fewer, not listed |
How to run dealer churn reports on Ilum, step by step
Five steps from an install to a list of quiet dealers every Monday morning. Each uses a part of Ilum that comes with the default install.
An install
Quiet dealers every Monday morning
- Helm chart
Add the chart repository and install it on any CNCF-compliant Kubernetes, in the cloud or on premises.
helm repo add ilum https://charts.ilum.cloud helm install ilum ilum/ilum - Spark
A Spark job reads the exports of your ERP or dealer portal from S3, GCS, Azure Blob or HDFS and writes
dealersandsales_transactionsas Delta tables. - SQL editor
Save Inactive Dealer Report and Dealer Onboarding Pipeline in the SQL editor in a folder such as
Retail Distribution/Operations. Both run on Spark SQL. - Schedules
Put the report into a PySpark job that writes its rows to a table, and schedule it on a five-field cron,
30 7 * * 1for Monday at 07:30. Ilum runs the schedule as a Kubernetes CronJob. How a schedule fires. - Roles
A
SALES_ANALYSTrole may run, save and edit SQL and read lineage, and holds neither JOB_CREATE nor SCHEDULE_CREATE. Dealer and manager names are tagged PII.
Questions and answers
How do you find dealers who stopped ordering?
Take each active dealer’s last sale from the order lines and band the days since it: more than 180 is at risk, more than 365 dormant, and no sale at all is never sold. In SQL it is one CTE with MAX(transaction_date) and a CASE.
After how many days without an order is a dealer at risk?
The report here says 180, and dormant after 365. Set it from how often your dealers order: a dealer that ordered every week and stops in April is listed at 180 days in October, at 90 days already in July.
How do I measure dealer onboarding and time to first sale?
Group new dealers by the quarter and region they were onboarded in, join each to its earliest order line, and count those with a sale and the days from onboarding to it.
Can the churn report run on a schedule?
Yes. Put the query in a Spark job that writes its rows to a table and give it a cron schedule. Ilum runs each schedule as a Kubernetes CronJob and starts a failed run again until its retries are used.
Can partner data stay on our own infrastructure?
Yes. Ilum installs with Helm on any CNCF-compliant Kubernetes, bare metal included, and keeps the tables in the object storage you give it.
Is Ilum open source?
No. Ilum Community is free to run under a license from Ilum. It is built on open-source engines such as Apache Spark, Trino and DuckDB.
Contact
Tell us about your cluster.
Name one workload you want to move.
Tell us where it runs today.
We answer with a plan, not a deck.
We reply within two working days.
