Reports and Key Figures: Fill Rate, No-Shows and Days of Supply
Turn app data into decisions: define key figures such as fill rate, no-show rate and days of supply, compute them over twelve weeks with SQL, smooth them with a moving average, and verify every figure with Python and JavaScript calculations.
In this lesson you will
- Define key figures precisely
- Compute them with grouped queries
- Smooth noisy weekly numbers
- Check dashboards against an independent calculation
About 28 minutes
What should Tomás look at on Monday morning?
After three months of use, the app holds a lot of data and Tomás wants a report page: is the volunteer rota getting better, are people turning up, and how long will the rice last. A dashboard is only useful if its figures are defined exactly. Fill rate is the places that were filled divided by the places on offer. No-show rate is the signups that did not attend divided by all signups. Days of supply is the quantity in stock divided by the average daily use. Each definition hides choices: which weeks count, whether cancelled shifts are included, and over what period the use is averaged. Write the definition next to the number on the dashboard, and use the same one every time.
Weekly numbers fluctuate, and a single bad week can look like a trend. A moving average over three or four weeks smooths them, at the cost of reacting later. Charts in no-code tools are built from the same grouped queries that you saw in the lesson on formulas: group by week, aggregate, sort. When a figure matters, compute it a second way: the same number from a different tool is the quickest way to find a wrong definition or a wrong join, and the most common error in dashboards is a join that multiplies rows, which inflates every sum.
| Figure | Definition | Pitfall |
|---|---|---|
| Fill rate | Filled places / places offered | Counting cancelled shifts |
| No-show rate | No-shows / signups | Dividing by shifts instead |
| Days of supply | Stock / average daily use | Using a quiet week for the average |
| Moving average | Mean of the last k weeks | Hides sudden changes |
| Active volunteers | Distinct people with at least one shift | Counting signups instead |
import sqlite3, json, random, datetime
rng = random.Random(2024)
db = sqlite3.connect(":memory:")
db.executescript("CREATE TABLE shifts (id INTEGER PRIMARY KEY, week INTEGER, capacity INTEGER); CREATE TABLE signups (shift_id INTEGER, volunteer_id INTEGER, attended INTEGER);")
sid = 0; srows = []; grows = []
for week in range(1, 13):
for _ in range(8):
sid += 1; cap = rng.choice([2, 3, 4]); srows.append((sid, week, cap))
n = min(cap, max(0, int(rng.gauss(cap * (0.55 + week * 0.025), 0.8))))
for v in rng.sample(range(1, 41), n): grows.append((sid, v, 1 if rng.random() > 0.15 - week * 0.004 else 0))
db.executemany("INSERT INTO shifts VALUES (?,?,?)", srows); db.executemany("INSERT INTO signups VALUES (?,?,?)", grows)
weekly = db.execute("""WITH cap AS (SELECT week, SUM(capacity) AS places FROM shifts GROUP BY week),
act AS (SELECT s.week, COUNT(*) AS signups, SUM(g.attended) AS attended, COUNT(DISTINCT g.volunteer_id) AS people
FROM signups g JOIN shifts s ON s.id = g.shift_id GROUP BY s.week)
SELECT cap.week, cap.places, COALESCE(act.signups, 0), COALESCE(act.attended, 0), COALESCE(act.people, 0)
FROM cap LEFT JOIN act ON act.week = cap.week ORDER BY cap.week""").fetchall()
naive = db.execute("SELECT SUM(s.capacity) FROM shifts s LEFT JOIN signups g ON g.shift_id = s.id").fetchone()[0]
print("week places signups attended people | fill rate no-show rate")
for w, cap, sg, att, ppl in weekly: print("%4d %6d %7d %8d %6d | %7.1f%% %9.1f%%" % (w, cap, sg, att, ppl, 100 * sg / cap, 100 * (sg - att) / sg))
fill = [sg / cap for w, cap, sg, att, ppl in weekly]
ma = [sum(fill[max(0, i - 2):i + 1]) / len(fill[max(0, i - 2):i + 1]) for i in range(len(fill))]
print("3-week moving average of the fill rate:", [round(100 * x, 1) for x in ma])
tot = db.execute("SELECT SUM(capacity) FROM shifts").fetchone()[0]; tot_places = tot; sg = len(grows); att = sum(g[2] for g in grows)
print("a naive join-and-sum of the places gives", naive, "instead of", tot_places, "(every signup repeats its shift capacity)")
print("overall: fill rate %.1f%% | no-show rate %.1f%% | distinct volunteers %d" % (100 * sg / tot, 100 * (sg - att) / sg, db.execute("SELECT COUNT(DISTINCT volunteer_id) FROM signups").fetchone()[0]))
use = [31, 28, 35, 30, 26, 33, 29]; stock = 214
print("days of supply: %.1f days (stock %d, average daily use %.2f)" % (stock / (sum(use) / len(use)), stock, sum(use) / len(use)))
print("DATA " + json.dumps({"weekly": weekly, "ma": ma, "overall": [tot, sg, att], "srows": srows, "grows": grows, "dos": stock / (sum(use) / len(use)), "naive": naive}))
week places signups attended people | fill rate no-show rate
1 24 10 10 10 | 41.7% 0.0%
2 25 13 12 12 | 52.0% 7.7%
3 26 13 11 12 | 50.0% 15.4%
4 29 14 10 13 | 48.3% 28.6%
5 26 9 8 9 | 34.6% 11.1%
6 26 18 16 16 | 69.2% 11.1%
7 26 16 16 12 | 61.5% 0.0%
8 21 13 12 11 | 61.9% 7.7%
9 23 17 17 15 | 73.9% 0.0%
10 24 18 17 13 | 75.0% 5.6%
11 25 13 13 11 | 52.0% 0.0%
12 23 14 9 12 | 60.9% 35.7%
3-week moving average of the fill rate: [41.7, 46.8, 47.9, 50.1, 44.3, 50.7, 55.1, 64.2, 65.8, 70.3, 67.0, 62.6]
a naive join-and-sum of the places gives 594 instead of 298 (every signup repeats its shift capacity)
overall: fill rate 56.4% | no-show rate 10.1% | distinct volunteers 39
days of supply: 7.1 days (stock 214, average daily use 30.29)
The sample data covers 12 weeks of eight shifts each, 40 volunteers and 168 signups. The weekly table shows the places offered, the signups, the people who attended and the distinct volunteers, with the two key figures beside it. The fill rate rose from 42 percent in week 1 to 61 percent in week 12, and the no-show rate fell from 0 percent to 36 percent, a trend that a manager could report with confidence once it has lasted for several weeks. Single weeks swing a lot, which is why the three-week moving average, 66, 70, 67, 63 percent in the last four weeks, is the line to show on the dashboard. Look at the line before the overall figures in the output block: a naive query that joins the shifts to the signups and sums the capacity reports 594 places instead of the true 298, because every signup repeats the capacity of its shift, and a fill rate computed from it would be badly wrong. The report above sums the capacity in a separate step to avoid exactly this. Over the whole period, the fill rate is 56.4 percent and the no-show rate is 10.1 percent.
Days of supply uses a different kind of calculation: with 214 tins in stock and an average daily use of 30.29 over the last seven days, the stock will last 7.1 days at the current rate. The choice of the averaging period matters as much as the arithmetic: a week of holiday closing would lower the average and exaggerate the supply, which is why the definition should say “over the last seven days of opening”. Whatever the figure, it only means something against a rule: for instance “reorder when below 10 days”, which connects the report back to the edge-triggered automation of lesson 6.
Independent check: the weekly table was recomputed in Python directly from the raw rows of shifts and signups, with dictionaries and sets and no SQL, and every number, places, signups, attendances and distinct people, matches the database’s grouped query. The moving average and the overall totals were also recomputed in JavaScript, and agree to twelve decimals. A mismatch between these would point at a wrong join or a wrong definition, the most common errors in dashboards, for example counting signups where distinct people were meant.
Check by hand with week 1: the table shows its places offered and signups, and the fill rate is the signups divided by the places. For the no-show rate, the attended number is subtracted from the signups, and the result is divided by the signups. For the distinct people in the week, one volunteer with two signups counts once.
If you join shifts to signups and then sum the shift capacity, every signup repeats the capacity and the places are overcounted. Sum capacity in a query of its own, or check against a total.
A small caption such as “fill rate = filled places / places offered, per calendar week” prevents arguments and prevents misreading.
No-code platforms, plans and limits change often, so the lessons describe categories of tools with generic names and you must check each vendor’s current website. The ideas of this course, data tables, forms, views, automations and permissions, are what the tools implement, so the lesson reproduces them in small programs, run in Python 3.13 or Node.js 22 on sample data, with a second independent calculation. The data in this lesson is generated for the exercise. Real data protection rules apply to reports that identify people.
Practice
Compute the share of volunteers who came more than once in the 12 weeks. Add a 4-week moving average and compare it with the 3-week one. Write the reorder rule for the rice and test it with the daily use numbers.
Check what you learned
Five quick questions. Pick an answer and you will see straight away whether it is right and why.
What is the fill rate?
- Signups divided by volunteers
- Shifts divided by weeks
- Filled places divided by places offered
- Attendance divided by capacity
Define it once.
Why use a moving average?
- It changes the data
- It smooths weekly swings
- It speeds up queries
- It hides the table
At the cost of a slower reaction.
What is a common cause of inflated sums in a report?
- Too few columns
- A join that repeats rows
- A short title
- A missing chart
Check against a total.
What is days of supply?
- Stock divided by average daily use
- Stock times use
- The number of items
- The number of shelves
Choose the averaging period carefully.
Why compute a figure in a second tool?
- To catch wrong definitions and joins
- To make reports longer
- Charts require it
- It is a law
Independent checks.
Summary
- Define each key figure exactly, with its period and what counts.
- Compute with grouped queries; watch for joins that multiply rows.
- Smooth noisy weekly figures with a moving average.
- Verify with an independent calculation.
Questions
How many figures should a dashboard have?
A handful that lead to actions. Dozens of figures hide the few that matter.
Can I trust the charts of my platform?
Usually, and check them against a calculation you can do by hand for one period. If they differ, find out why.
How often should I look?
Weekly for a volunteer rota, and when an alert fires. More often leads to reacting to noise.
