In short
AI sales analytics starts with the export you already have. You do not need a new platform for the first pass. A quarter of deals from your CRM, invoices from your accounting system, and ChatGPT or Claude with file analysis are enough to see within an hour where the funnel leaks, why deals are lost, and which customers have stopped buying.
This guide follows one example from start to finish. A wholesale distributor sells supplies to retailers and restaurants. Reps work deals in HubSpot, and finance invoices from QuickBooks. After the quarter closes, the head of sales wants answers to three questions:
- At which pipeline stage do we lose the most money?
- Why do we really lose deals, beyond what the "closed lost reason" field says?
- Which regular customers are drifting away?
We take those two tables through three levels. First a chat window, which any manager can use. Then Claude Code or Codex on your own computer, where the math is done in code you can check. Finally a system that pulls data from the CRM and accounting on its own and sends a report every week.
Rep oversight, stale deals, and call reviews are a separate topic, covered in how AI helps control a sales team. This article is only about analyzing the numbers.
What AI can do with your sales data
AI is useful for sales analysis wherever the data exists but nobody has time to dig through it. The main jobs:
- Funnel. Stage-to-stage conversion, time in stage, and splits by rep, lead source, and region. The model finds the stage where deals sit longer than they should.
- Loss reasons. The CRM loss-reason field often says "Other" or "No decision." The real reason is in rep notes and email threads. AI reads that text and sorts it into categories.
- Calls and emails. Transcripts from your call recorder and email threads show what buyers ask before they sign and which objections come up most.
- Churn. Invoice history shows who used to buy every month and went quiet. AI finds those accounts and matches them to their CRM history.
- ABC/XYZ segmentation. Which customers and products bring most of the revenue, and whose demand is steady or erratic. This used to take a spreadsheet full of formulas. Now you ask.
- Forecast. A rough revenue estimate for next quarter from open deals and historical conversion. Fine as a planning reference; a budget needs a second check.
None of this needs a developer as long as the data fits in a couple of tables. The harder part starts when the report is needed every week and the data lives in several systems. That comes at the end.
Level 1: upload the table to ChatGPT or Claude
Both ChatGPT and Claude accept Excel and CSV files and run Python on them, so the numbers are computed rather than guessed. ChatGPT lets you expand the code behind an answer, and Claude also shows what it ran. A standard paid plan is enough to start.
Preparing the export
Half the result is decided before the first prompt. Our example uses two tables.
A quarter of HubSpot deals. Export the deals view to Excel or CSV. Useful columns: deal ID, company, company domain, pipeline stage, status, owner, source, amount, create date, close date, closed lost reason, and the latest note. If your team does not log loss reasons, export the notes at least.
Invoices from QuickBooks for the same quarter and the two before it. A sales-by-customer report by month: customer, month, amount, and number of invoices. Six months of history is what lets you see who stopped buying.
Then three preparation steps:
- A column dictionary. Five to ten lines of plain text: whether "Amount" includes tax, which currency it uses, what "Closed lost" means in your pipeline, and the order of the stages. Without it the model guesses, and sometimes it guesses wrong.
- Remove personal data. Strip phone numbers, emails, and contact names. You can replace company names with codes and keep the lookup table yourself. If you sell into the EU or California, GDPR and CCPA apply to what you send to an outside service, and a de-identified export avoids most of the questions.
- One key across both tables. Deals and invoices need to join. A shared customer ID is best; the company domain or a tax ID also works. Joining on company name is possible, but "Acme Inc." and "ACME, Inc" will count as two customers until you tell the model otherwise.
Check whether your chat settings allow your conversations to be used for model training, and turn that off. On ChatGPT Business or Enterprise and on Claude's team plans, business data is not used for training by default, which is the better choice for company data.
Five prompts for one table
Upload both tables and the dictionary in one message, then ask the questions one at a time. End each prompt by asking to see the calculation.
1. Data check. "Describe both tables: row counts, date ranges, empty values per column, duplicate deals and companies. Don't calculate anything yet."
This is the most underrated prompt. In our example the model might report: "1,240 deals; 18% of deals marked closed have no close date; 37 companies appear under two spellings." The numbers are illustrative, but findings like these turn up in almost every CRM.
2. Funnel. "Calculate stage-to-stage conversion for the quarter overall and per rep. Show how much deal value dropped out at each stage. Also give the median time in each stage."
3. Loss reasons. "Take the closed-lost deals. Using the loss reason and the latest note, sort them into: price, delivery time, went with a competitor, no response, wrong product, other. Show the shares and five example notes per category."
Set the categories yourself. If the model picks them, next quarter it will invent different ones and the periods will not compare.
4. Drifting customers. "In the invoice table, find customers who bought in at least four of six months and did not buy in the last two. Match them to HubSpot companies: any open deals, who owns the account, when the last activity was."
5. One-page summary. "Combine the previous answers into one page: the three biggest problems of the quarter, the number behind each, and what to check first. Next to every number, note which calculation produced it."
Checking the numbers the model produced
Models can be wrong with full confidence. The mistake is rarely in the arithmetic. Usually it is in a filter: deals from the wrong period, won and lost mixed together, amounts with and without tax side by side. Three habits catch most of it:
- A control total. Ask for total revenue for the quarter and compare it with a figure you already know from QuickBooks or HubSpot. If it doesn't match, stop there.
- A manual sample. Take 20 to 30 deals from the loss-reason answer and read the notes yourself. If the model got one in five wrong, don't trust the percentages.
- The code. Expand it and look at the filters at least: which period, which statuses, which amount column. You don't need to read Python for that; the conditions are visible by column name.
How much time this saves depends on the data. For tables of this size, our estimate for the example: an analyst building the same breakdown by hand in Excel needs a day or two, while a chat gets first answers in about an hour, checks included. Treat that as an illustration, not a measured client result.
Level 2: Claude Code or Codex on your own computer
Claude Code from Anthropic and Codex from OpenAI are AI agents that run on your computer. You open a folder, the agent sees the files in it, writes scripts for the calculations, runs them, and saves the output next to them: tables, charts, a report. You can use them in a terminal or in a desktop app. Claude Code is included in Claude Pro and Codex in ChatGPT Plus, so there is nothing extra to buy to start.
No programming is required. The adjustment is that you work with a folder of files rather than a conversation.
Why an agent is more reliable than a chat
In a chat, the calculation lives inside one conversation. A month later you upload a new export and explain again what "Amount" means and how the tables join. The answer may come out slightly different, because the model rewrites the code each time.
An agent saves its scripts in the folder. The funnel calculation becomes a file you can open, hand to an analyst, or rerun on new data. If a number looks off, you can trace where it came from: this script, this filter, this source row. You end up reviewing code rather than trusting the model's memory.
For our example, the five prompts from level 1 turn into a set of scripts once. Next quarter you drop in fresh exports and ask: "Recalculate everything on the new data and compare it with last quarter."
Folder, dictionary, and a scheduled report
Keep the project folder simple:
data/for the HubSpot and QuickBooks exports;reports/for finished reports;- an instruction file for the agent at the root.
Claude Code reads instructions from CLAUDE.md, Codex from AGENTS.md. It is the same column dictionary, except it no longer gets lost between conversations. A five-line example:
# Sales analytics
- Deals: data/hubspot_*.csv, invoices: data/qbo_*.xlsx, join on customer_id.
- HubSpot amounts exclude tax; QuickBooks totals include it. Compare net of tax.
- A lost deal is any deal in the "Closed lost" stage.
- Use loss categories from loss_reasons.md only. Never invent new ones.
- Next to every number in a report, name the script that produced it.
Once the analysis is stable, it can run on a schedule. Claude Code has a non-interactive mode (claude -p "..."), and Codex has codex exec. Put either in cron or Windows Task Scheduler, and every Monday a fresh summary appears in reports/. Someone still has to drop the exports in by hand, and that is the real limit of level 2.
Learn it yourself
If you want to learn this way of working without hiring anyone, join the course waitlist. The course covers chat, Claude Code, and Codex on participants' own tasks. Enrollment is paused for now; one-on-one sessions are available on request.
Four questions to answer first
A CRM holds enough data to drown in reports for their own sake. Start with four questions. They pay off faster than the rest and fit our two tables well.
Where does the funnel lose the most money?
Look at the deal value that dropped out at each stage before you look at conversion. A "proposal sent" stage converting at 40% can cost more than a "first call" stage converting at 15% if the large deals reach the proposal. Ask the agent for a stage-by-rep table in dollars. Usually one or two reps account for most of the loss at one stage, and that is a coaching question more than a market one.
Why do we lose deals?
This is where AI helps most, because nobody has time to read several hundred notes by hand. The agent tags notes and emails using your categories. Before trusting the shares, read 50 to 100 tagged deals yourself.
Which customers are drifting away?
The answer is in the invoices. In the CRM a customer looks alive as long as there is an open deal, even if they stopped ordering two months ago. Join invoice history to company records and you get a list: bought regularly, went quiet, nobody called. Sales can work that list the same day.
What will the current pipeline actually bring in?
The total of open deals in the CRM almost always overstates the forecast. Ask the agent to multiply deals at each stage by that stage's historical win rate and to account for deals older than three months closing less often. The result is rough but honest. It is good enough for planning; a budget needs a check with finance.
Where AI gets it wrong
A messy CRM. Dead deals nobody closed, duplicate companies, stages reps skip. The model will count all of it quickly and confidently. That is why the first prompt in our example is about data quality, not findings. Cleaning data at the source and connecting the CRM are covered in AI integration in CRM.
Duplicates and spellings. "Acme Inc.", "ACME, Inc", and "Acme Incorporated" are three customers to the model until you say otherwise. Join on IDs wherever you can, and ask the agent to list borderline matches for review.
Numbers without a calculation. If the model states a figure but shows no code that computed it, the figure stays out of the report. In a chat this happens when the question reads like conversation rather than a calculation task. Add "calculate it in code and show the calculation" to the prompt.
Comparing apples and oranges. Amounts with and without tax, invoice dates versus payment dates, booked versus billed. All of this belongs in the dictionary, or CRM and accounting numbers will never reconcile.
Overconfident explanations. Models happily explain causes: "the drop is seasonal." Sometimes that is true and sometimes it is a guess. Ask the model to separate facts from the data and hypotheses.
How to train the sales team and analysts
One manager with ChatGPT does not make a sales team data-literate. Shared rules do: one column dictionary, one set of loss categories, and an agreement that every number in a report can be traced. Without them, three people upload the same export and get three different answers.
Training works best on the team's own exports. Practice tables hide the mess of a real CRM. Analysts learn Claude Code or Codex and the project folder, managers learn to ask questions and check answers, and reps see why CRM hygiene shapes what the report says about them. How we run these sessions for teams is described on the corporate AI training page. If the company already has an internal assistant, the same data rules apply there too; see internal ChatGPT for a company.
Level 3: when ad-hoc analysis should become a system
An agent on an analyst's laptop is good for exploration. Signs it is time for a system:
- the report is needed every week, and one person uploads the exports by hand;
- regional managers read the answers, and each should see only their own data;
- quotas, bonuses, or purchasing decisions depend on the numbers;
- you need to know who asked what and which data they saw.
In a system the data arrives on its own. Deals come from the HubSpot or Salesforce API, invoices from the accounting system's API, and everything lands in a copy of the data where the AI has read-only access. The model connects to that copy through MCP, a standard way to give AI access to outside systems. On top of that you need roles, query logs, scheduling, and monitoring.
The main difference from level 2 is quality control. Keep 50 to 100 reference questions with answers an analyst computed by hand, and rerun them after every change of model, dictionary, or data structure. That set is called evals; how to build one is in why AI projects need evals.
Start with one report, such as a weekly summary of the funnel and drifting customers. How to run that kind of pilot is in an AI pilot in 30 days. If you want a system on your own data, with the CRM and accounting connected and the numbers checked, see the AI for sales service.
Chat, agent, or system: a comparison
| Chat (ChatGPT, Claude) | Agent (Claude Code, Codex) | System | |
|---|---|---|---|
| Who it suits | A head of sales or owner doing a one-off review | An analyst or manager repeating the analysis every month | A company where several people read the report and decisions depend on it |
| Where the data comes from | Manual export for every conversation | Exports in a folder, scripts saved | Pulled automatically from CRM and accounting |
| How to check the numbers | Expand the code, control total | Scripts in the folder, rerun | Reference questions and monitoring |
| Main risks | A wrong filter, data sent to an outside service | Everything depends on one person and their laptop | Build time and cost |
| Cost | A ChatGPT Plus or Claude Pro plan, about $20 a month | The same plan; heavier use needs a higher tier | A project, estimated after reviewing your data |
Most companies should go through the levels in order. Chat shows whether the answers are in the data. The agent shows which calculations you need regularly. A system makes sense once you know both. For the wider picture of AI in revenue teams, see AI for sales teams.
FAQ
Which AI is best for sales analysis?
For tables, ChatGPT and Claude both work: each computes on the file in code and shows the calculation. The gap between them is smaller than the gap between a clean export and a messy one. Run the same control questions on both and compare.
Do I need to code to use Claude Code for sales analytics?
No. The agent writes the code. Someone still has to understand the data and check that the period, statuses, and amounts are right. Without that check, a wrong filter goes unnoticed.
Is it safe to upload sales data to ChatGPT?
It depends on what you upload. De-identify the export: remove phone numbers, emails, and names, and replace company names with codes. Turn off training on your conversations, or use a business plan. Regular work with personal data calls for a system with access control, not a personal chat.
Can AI connect directly to HubSpot, Salesforce, and our accounting system?
Yes, through their APIs. For a one-off analysis that is unnecessary; an export to Excel is enough. A direct connection makes sense once the report runs regularly. Start with read-only access and a copy of the data.
How is this different from Power BI or Looker?
BI shows reports someone set up in advance. AI answers new questions, reads notes and emails, and explains why a metric moved. It sits on top of the BI and CRM stack and does not replace it.
When should we move from a chat to our own system?
When the report runs regularly, several people with different access rights read it, and quotas or bonuses depend on the numbers. At that point you need automatic data loading, roles, logs, and quality checks.
