AI for retail
AI for retail lets you ask your own till and stock data which lines have stopped selling while the books still show units. Each line comes back with the store, the days and the rule that flagged it. The same data sets staffed hours against door counts and checks each delivery against its dispatch note.
One question, traced, example
3 of 8 lines hold 71 book units but have stopped selling
You asked
Which lines show stock on the books but no sales at store 07?
Checked stock against till sales7 steps
-
Read the question
You want lines that store 07 holds on paper but has stopped selling. I used the gifts and accessories bay and stock as at close on 15 November 2026, the last full day.
-
Decide whether to query
Stock and till sales change every day, so this needs the store's own data, read today.
-
Pick the dataset
Used tills.sales_lines, one row per line per till sale, and stock.stock_on_hand, one row per line per store per day. merch.products gives the bay. Door counts aren't needed for this.
-
Set the rule
A line's sales rate is the units it sold in the 56 days up to its last sale, divided by 56. If sales arrive at random at that rate, a run of ln(100) ÷ rate days with no sale has a chance of 1% or less. A line past that limit, with stock on the books, goes on the shelf-check list.
-
Write the query
Last sale date and rate per line, then book stock for the day, then the limit and the flag.
WITH last_sale AS ( SELECT s.sku ,MAX(s.sale_date) AS last_sale_date FROM tills.sales_lines s WHERE 1=1 AND s.store_id = 'S07' AND s.units > 0 GROUP BY s.sku ) ,sales_rate AS ( SELECT l.sku ,l.last_sale_date ,SUM(s.units) / 56.0 AS units_per_day FROM last_sale l JOIN tills.sales_lines s ON 1=1 AND s.sku = l.sku AND s.store_id = 'S07' AND s.units > 0 AND s.sale_date > l.last_sale_date - 56 AND s.sale_date <= l.last_sale_date GROUP BY l.sku ,l.last_sale_date ) SELECT p.description ,k.units AS book_stock ,ROUND(r.units_per_day, 3) AS units_per_day ,DATE '2026-11-15' - r.last_sale_date AS days_since_sale ,ROUND(LN(100) / r.units_per_day, 1) AS likely_gap_limit ,DATE '2026-11-15' - r.last_sale_date > LN(100) / r.units_per_day AS shelf_check FROM stock.stock_on_hand k JOIN sales_rate r ON 1=1 AND r.sku = k.sku JOIN merch.products p ON 1=1 AND p.sku = k.sku WHERE 1=1 AND k.store_id = 'S07' AND k.snapshot_date = DATE '2026-11-15' AND k.units > 0 AND p.category = 'Gifts and accessories' ORDER BY shelf_check DESC ,days_since_sale DESC -
Run the query
Ran against the read-only view. Nothing was written.
Write the answer
Every figure below comes from those 8 rows.
- Canvas tote, natural Days since last sale 9, likely-gap limit (days) 3.1. 22
- Ceramic mug, blue Days since last sale 6, likely-gap limit (days) 1.5. 31
- Socks, 3-pack Days since last sale 5, likely-gap limit (days) 1.8. 18
- Umbrella, black Days since last sale 15, likely-gap limit (days) 36.8, book stock 6.
- Fig candle Days since last sale 11, likely-gap limit (days) 18.4, book stock 12.
- Leather gloves, brown Days since last sale 4, likely-gap limit (days) 9.2, book stock 9.
- Wool scarf, grey Days since last sale 1, likely-gap limit (days) 2.3, book stock 14.
- A5 notebook Days since last sale 0, likely-gap limit (days) 1.2, book stock 40.
tills.sales_lines and stock.stock_on_hand, store 07, close on 15 November.Three lines in the gifts bay look empty on the shelf while the system holds 71 units of them. The canvas tote has gone 9 days without a sale against a limit of 3.1, the blue mug 6 days against 1.5, and the 3-pack socks 5 days against 1.8. The umbrella has the longest quiet spell, 15 days, but it sells just under one a week, so its limit is 36.8 days and it isn't flagged. Check the three flagged lines on the shelf and in the stockroom before anything is reordered.
Show the numbers
| Line | Book stock | Units per day | Days since last sale | Likely-gap limit (days) | Shelf check |
|---|---|---|---|---|---|
| Canvas tote, natural | 22 | 1.500 | 9 | 3.1 | Yes |
| Ceramic mug, blue | 31 | 3.000 | 6 | 1.5 | Yes |
| Socks, 3-pack | 18 | 2.500 | 5 | 1.8 | Yes |
| Umbrella, black | 6 | 0.125 | 15 | 36.8 | No |
| Fig candle | 12 | 0.250 | 11 | 18.4 | No |
| Leather gloves, brown | 9 | 0.500 | 4 | 9.2 | No |
| Wool scarf, grey | 14 | 2.000 | 1 | 2.3 | No |
| A5 notebook | 40 | 4.000 | 0 | 1.2 | No |
What AI for retail can do with your data today
Stock turn and GMROI for the same lines are on the retail KPIs page.
What does not work yet
A line with 31 units on the books and no sale in six days is a shelf problem until someone has looked.
What has to be true of your data first
One product code on the tills and in the merchandise system
The check skips any till line that doesn't match stock on hand, so the unmatched codes come first as a list to fix.
Stock on hand by store by day, with every day kept
A file that overwrites yesterday's figure can't date the last sale against the stock that was there.
Counter outages flagged hour by hour
If the counter drops out at 2pm on a Saturday, that hour looks overstaffed. A flag on each outage hour keeps it out of the comparison.
Goods-in scans that carry the delivery reference
Without it, no scan can be tied to the note it arrived on.
The AI readiness assessment runs these four checks on one store's till, stock and counter files and reports each as a pass or a named fix.
Regulation and risk notes for AI in retail
What the ICO's camera and biometric pages say, dated.
Facial recognition
The ICO's Biometric data guidance: Biometric recognition, page "Biometric recognition", says
"If you use a biometric recognition system, you are using special category biometric data."
The same guidance, in its chapter "How do we demonstrate our compliance with our data protection obligations?", says
"You must complete a DPIA before you use a biometric recognition system."
Checked 20 November 2026.
Facial recognition in shopping centres
The ICO's guidance "Video surveillance (including guidance for organisations using CCTV)", in its section "Facial Recognition Technology (FRT) and surveillance", says
"The context in which you are using such systems is a key consideration when you determine whether your use of FRT is appropriate. For example in shopping centres, you still need to be able to strongly justify that your use of FRT is lawful and necessary to achieve your outcome, and that you could not do so using less privacy intrusive methods."
Checked 20 November 2026.
Surveillance and the data protection principles
The same guidance has a page headed "How can we comply with the data protection principles when using surveillance systems?".
Checked 20 November 2026.
Review notice
Each ICO page above says
"Due to changes made by the Data (Use and Access) Act, this guidance is under review and may be subject to change."
Checked 20 November 2026.
The legislation on automated decisions and the ICO's AI guidance are listed once, on the AI for your industry page.
This is a list of the sources we read, with the date. It is not legal advice, and your own adviser decides what applies to you.
Further reading
The weekly trading view, like-for-like sales and weeks of cover are on the retail analytics page. If you also run a web shop, AI for ecommerce covers returns, product copy and marketing email. Shelf-check results also feed demand forecasting, and AI-led analytics covers the whole service, from the data layer to the traced answer.
Questions people ask
Can AI spot empty shelves from our stock data?
It can tell you where to look. When a line with stock on the books goes longer without a sale than its own rate makes likely, it goes on a shelf-check list for someone in the store.
Can we use AI on our CCTV footage?
No. We don't build recognition or work with footage. The ICO's Biometric data guidance: Biometric recognition says "Biometric recognition describes when you use biometric data to uniquely identify someone." Its page "How do we demonstrate our compliance with our data protection obligations?" says "You must complete a DPIA before you use a biometric recognition system." Checked 20 November 2026.
Does the stock alert work for slow sellers?
Yes, it just waits longer, until the gap is unlikely at that line's own rate. In the example above, the umbrella is quiet for 15 days and still isn't flagged, because its limit is 36.8 days.
Will the alert replace our stock counts?
No, a count is still the only thing that corrects the book figure. The alert points your store team at the lines most likely to be wrong between counts, so a mug that sold three a day and then nothing gets looked at this week.
Why is a line's sales rate measured up to its last sale?
Because a rate measured up to today falls every day a line sits unsold, and a falling rate pushes the limit further out. The longer the shelf stayed empty, the harder the line would be to flag. Taking the 56 days before the last sale keeps the rate the line had while it was still selling.
Which of your lines have stopped selling while the books still show stock?
A month of till and stock files for one store and one bay gives the first call a list of the lines the gap rule would have sent for a shelf check.