Bethan Lister

How to write queries for shipment data analysis

Ticketclosed

Brakkevoort Logistics: documents logo Brakkevoort Logistics: documents · How to write queries for shipment data analysis

Customer building shipment analysis queries got inconsistent results. Bethan explained timestamp handling and the need for GROUP BY, resolving the issue.

Priority high

What happened

What this says

Current to 11 Oct 26

Customer building shipment analysis queries got inconsistent results. Bethan explained timestamp handling and the need for GROUP BY, resolving the issue.

Problem: Bas Vermeulen writing queries on shipment data was getting different record counts depending on query structure. Handling: Bethan identified two issues: the timestamp field includes a time component (catches at boundaries with date-only filters) and shipments can have multiple status records (requiring GROUP BY to avoid double-counting). She provided the correct query pattern and Bas confirmed it worked.

AI · claude-haiku-4-5-20251001 · 11 Oct 2026

Details

Updated 9 Oct 26
Priorityhigh
Statusclosed
Categoryhow_to
Channelemail
First response (min)34
CSAT5
Helpdeskmade from

Trail

  1. Bas Vermeulen
    created · Bas Vermeulen 7 Aug 2026 17:20
    Hi, I'm trying to set up a way for our account managers to query shipments by customer reliably, but we're getting inconsistent results. I've written a couple of queries and they're returning different counts depending on how I structure them. Not sure if it's a syntax issue or the way I'm filtering. We need this working reliably, can you walk me through the right approach?
  2. Bethan Lister
    public_reply · Bethan Lister 7 Aug 2026 17:54
    Thanks for that. Just so I've got this right: you're writing queries to find shipments by customer and date, and you're getting different numbers depending on the query? Can you share the two versions and what counts they're returning? That'll help me see what's happening.
  3. Bethan Lister
    public_reply · Bethan Lister 10 Aug 2026 12:57
    I've picked this up now. The issue is how your timestamp field works. Your shipment arrival field includes the time component, so filtering by date alone might catch records at the boundary. Also, shipments can have multiple status records in the brain, so if you're not grouping by shipment ID you could be double-counting. Here's the way to write it: use a date-range filter on arrival and group by shipment ID. Can you try that and tell me what you see?
  4. Bas Vermeulen
    public_reply · Bas Vermeulen 10 Aug 2026 13:32
    That works, thanks. I ran the query the way you described and the numbers are consistent now. Much appreciated.
  5. Bethan Lister
    status_change · Bethan Lister 10 Aug 2026 13:50
  6. status_change · 14 Aug 2026 23:59
Helpdeskmade from

BB-Demo is a fictional company; every organisation and person here is invented. B-Brain is the tool. Built by site/build_site.py from the site tree, data as of Fri 9 Oct 2026. Help & Support

Help & Support

Open as a page

Help & Support

B-Brain is one place to read everything the company knows about its customers: the CRM, calls, emails, support tickets, product usage, invoices, documents, news and HR. Every page is built from those systems and the data is current to Fri 9 Oct 2026.

How to use the site

How to ask

Press Ask Brain in the header. Type a question, or pick one of the examples.

The site itself does not call an AI model; answers in Claude come from the same figures you see here.

What the data covers

DataRecords
Organisations75
People at customers290
BB-Demo staff40
Calls784
Email threads1,169
Support tickets449
Documents477
Deals117
Invoices101
Events49
News items56

Data as of Fri 9 Oct 2026. Text marked AI was written by the brain from the records listed in its made-from link; an AI output that cannot cite its evidence is refused and the previous text kept. Where two systems disagree (for example a contract and the CRM), the key facts show both values and mark the difference.

BB-Demo is a fictional company: every organisation, person and figure here is invented for this demonstration. B-Brain is the tool that reads its data.

Who to contact

Email support@b-brain.example or talk to your B-Brain account team. Tell us the page address and what looked wrong; a screenshot helps.

Ask B

Ask B

B-Brain · read-only