Analyze Sales Data with Claude AI
Use Claude AI to explore, visualize, and report on real sales data.
Introduction
30 Second Summary
Every business collects data, but most of it sits untouched in spreadsheets because analyzing it traditionally requires coding skills and specialized tools. What if you could turn thousands of rows of raw data into clear insights just by asking questions in plain English?
In this project, you will use Claude AI as your personal data analyst to explore, visualize, and generate a professional report from a real sales dataset. No coding required.
What You'll Build
You'll upload a CSV file of coffee shop sales data to Claude and progressively guide it through a complete analysis workflow using natural language prompts.
By the end of this project, you'll have:
- A cleaned and profiled dataset with summary statistics and data quality checks.
- Multiple data visualizations (bar charts, line charts, heatmaps) showing sales patterns, downloaded as image files.
- A downloadable PDF report with executive-level insights, charts, and actionable business recommendations.
- Secret Mission: Build an interactive HTML dashboard with filters and dynamic charts that let you explore the data visually.
Are there any prerequisites?
None. This project walks you through setting up everything you need, including a free Claude account and the sample dataset. You do not need any coding or data analysis experience.
Before We Start
Before We Start...
Set Up Your Claude Account
Before you can use AI to analyze data, you need two things: an AI assistant that can run code, and a dataset to explore.
In this step, you'll create your free Claude account, download a real coffee shop sales dataset, and upload it to start your first conversation.
In this step, get ready to:
- Create a free Claude account and confirm code execution is enabled.
- Download the Coffee Shop Sales dataset from Maven Analytics.
- Upload the dataset to Claude and start a new conversation.
Create your free Claude account
Claude is an AI assistant that can write and execute Python code directly in your browser. This means it can load your data files, compute real statistics, and generate downloadable charts and reports.
- Open your web browser and navigate to claude.ai.
- Click Sign Up to create a free account using your email address or a Google account.
- If you already have a Claude account, click Log In instead.
- Complete the sign-up process by following the on-screen prompts (email verification, name entry).
Once you're logged in, you'll land on the Claude chat interface.
- Click your initials or name in the lower left corner of the screen.
- Select Settings from the menu.
- Click Capabilities in the left sidebar of the Settings page.
- Confirm that the Code execution and file creation toggle is switched on.
✔️ It's already toggled on
You're all set. This toggle is enabled by default for all plans including the free tier.
ⓧ It's toggled off
- Click the toggle next to Code execution and file creation to switch it on.
- Close the Settings page by clicking the X in the top right corner.
What is code execution?
When code execution is enabled, Claude can write Python code and run it in a private computing environment. This is what allows Claude to load your CSV file, calculate real statistics, and generate downloadable files like charts and PDF reports.
Without it, Claude can only read and infer patterns from the text of your file. With it, Claude computes exact answers using real Python data science libraries.
Download the sample dataset
You'll use a real sales dataset from a fictitious coffee shop in New York City. It contains 149,116 transaction records with 11 fields covering dates, products, store locations, prices, and quantities.
- Open a new browser tab and go to the Maven Analytics Data Playground.
- Scroll down or search for the dataset titled Coffee Shop Sales.
- Click View details or the dataset card to open its detail page.
- Click Download dataset.
- Maven Analytics will prompt you to create a free account if you don't have one. Sign up with your email to complete the download.
- Save the downloaded CSV file somewhere easy to find, such as your Desktop or Downloads folder.
Why this dataset?
The Coffee Shop Sales dataset is large enough (149,116 rows) to produce meaningful patterns and trends. It also has a variety of fields (dates, products, locations, prices) that let you practice different types of analysis.
It's small enough to upload to Claude without any issues. Claude supports file uploads up to 500 MB per file.
Can't find the download button?
Make sure you've created a free Maven Analytics account first. The download button only appears after you're signed in. Look for the Sign Up Free option in the top right corner of the Maven Analytics page.
Help me find and download the Coffee Shop Sales dataset from Maven Analytics.
Upload the dataset to Claude
Now you'll connect your dataset to Claude by uploading it into a new conversation.
- Switch back to your Claude browser tab.
- Start a new conversation by clicking the compose icon or New chat at the top of the sidebar.
- In the chat box at the bottom of the screen, click the + button in the lower left corner.
- Select Add files or photos from the menu that appears.
- Navigate to where you saved the Coffee Shop Sales CSV file and select it.
- Once the file appears attached to your message, type a short greeting like Hi! I just uploaded a sales dataset. Can you confirm you received it? and press Enter to send.
Claude should respond by acknowledging your file and briefly describing what it contains (a CSV with transaction records).
Claude doesn't mention your file?
Check that the file is actually attached before you press Enter. You should see the filename displayed below the chat input box. If the file didn't attach, try clicking the + button again and re-selecting the file.
Help me upload my CSV file to Claude.
Your tools are ready and Claude has your data. Next up, you'll ask Claude to explore and profile the dataset to understand what you're working with.
Explore and Profile the Data
Your dataset is uploaded and Claude has acknowledged the file. Now it is time to understand what you are working with.
Before jumping into visualizations or reports, any good data analysis starts with profiling. You need to know the shape of the data, whether it has quality issues, and which questions are worth answering.
In this step, get ready to:
- Profile the dataset structure using Claude's code execution.
- Check data quality with summary statistics.
- Identify the most impactful business questions to answer.
Ask Claude to profile your dataset
Claude has two ways of handling data. It can read data as text and infer patterns, or it can run actual Python code to compute precise results. The text-reading approach can sometimes hallucinate numbers. Code execution gives you accurate, verifiable answers.
To make sure Claude runs real code instead of guessing, you need to be explicit in your prompt. Starting with phrases like "Use code execution to..." triggers the code execution environment.
- Type the following prompt into the Claude chat box and press Enter:
Use code execution to load this CSV file. Print the row count, column names and data types, and the first 5 rows. Then give me a summary of what this dataset contains.
What does this prompt do?
This prompt explicitly tells Claude to use its code execution environment. Claude will write and run a Python script behind the scenes that loads your CSV file using a library like pandas, then prints the results directly.
You will see Claude show you the Python code it ran alongside the output. This transparency lets you verify the results are computed, not guessed.
Claude will respond with a structured breakdown of your dataset. You should see the row count (149,116 records), a list of 11 column names with their data types, and a preview of the first 5 rows showing transaction dates, product details, store locations, prices, and quantities.
Why say "Use code execution" explicitly?
Claude has a private computing environment that runs Python with common data science packages pre-installed. When you ask Claude to "analyze" data without being specific, it might try to answer from the text alone, which can produce inaccurate numbers.
Saying "Use code execution" forces Claude into its sandboxed Python environment where it actually loads the file, runs computations, and returns real results. This is the difference between an estimate and a fact.
Claude described the analysis but did not run code?
If Claude responded with text like "I would load the file and check..." instead of actually running Python code, try rephrasing your prompt to start with "Run Python to..." or "Execute code to...". This makes the intent clearer.
Also confirm that code execution is enabled in your account. Go to Settings > Capabilities and check that Code execution and file creation is toggled on.
Help me get Claude to run code on my uploaded CSV file instead of just describing what it would do.
Check data quality with summary statistics
Knowing the structure is a start, but you also need to check if the data is trustworthy. Missing values, duplicates, or unexpected outliers can skew any analysis you build on top.
- Type this prompt into the Claude chat box and press Enter:
Calculate summary statistics for all numeric columns. Check for missing values, duplicates, and any data quality issues. Summarize what you find.
What does this prompt do?
Claude will run Python code to compute statistics like mean, median, min, max, and standard deviation for numeric columns (like price and quantity). It will also scan for null values and duplicate rows across the entire dataset.
The summary at the end tells you whether the data is clean enough to analyze directly, or whether you would need to handle issues first. For this dataset, Claude typically finds the data is well-structured with no major quality problems.
You should see a table of summary statistics for columns like transaction quantity and unit price. Claude will also report its findings on missing values and duplicates.
Claude's statistics look wrong or incomplete?
If Claude only shows statistics for one or two columns, it may not have loaded all numeric fields. Ask a follow-up: "Can you show the full describe() output for all numeric columns?" This tells Claude exactly which pandas method to use.
Help me get complete summary statistics from Claude for my sales dataset.
Identify business questions for deeper analysis
You now know what the data looks like and that it is clean enough to work with. The next step is to decide what questions are worth answering. Instead of guessing, you can use Claude as a thinking partner to suggest high-impact questions based on what it has already seen.
- Type this prompt into the Claude chat box and press Enter:
Based on this data, what are the 5 most interesting business questions we could answer? Rank them by potential business impact.
What does this prompt do?
This prompt asks Claude to think strategically about the data, not just compute numbers. Claude will consider the columns available (dates, products, locations, prices, quantities) and suggest questions that would matter to a business owner.
You are learning to use AI as a thinking partner here. Instead of just asking Claude to crunch numbers, you are asking it to help you decide which numbers are worth crunching in the first place.
Claude will respond with a ranked list of 5 business questions. These typically cover topics like peak sales times, top-performing products, revenue trends over time, store location comparisons, and customer purchasing patterns.
Your questions may differ
Claude may suggest slightly different questions each time you ask. That is perfectly fine. The goal is to have a prioritized list of questions that guide your next steps. If you see a question that interests you more than the others, make a mental note. You will explore these patterns in the next step.
Claude gave generic questions not tied to the data?
If Claude's questions seem vague or unrelated to your actual columns, try adding context: "Look at the specific columns in this dataset and suggest questions we can answer with the data we actually have." This grounds Claude in what is available.
Help me get better business questions from Claude about my sales data.
Your dataset is fully profiled and you have a clear direction for analysis. Next up, you will ask Claude to create visualizations that answer these business questions with charts and graphs.
Visualize Sales Patterns
You now have a clear picture of the dataset's structure, quality, and the most interesting questions to explore. Numbers in a table are useful, but charts reveal patterns that raw data hides.
In this step, you'll prompt Claude to generate professional data visualizations from the coffee shop sales data. You'll create four different chart types, each designed to reveal a specific sales pattern.
In this step, get ready to:
- Create a time-series line chart showing daily revenue trends.
- Generate bar charts breaking down revenue by product category and top-selling items.
- Build a heatmap revealing peak transaction hours by day of week.
Create a time-series revenue chart
A line chart of revenue over time is one of the most revealing visualizations for any business dataset. It shows trends, seasonality, and outliers at a glance.
- In your Claude conversation, send the following prompt to generate the first chart:
Create a line chart showing total daily revenue over time. Use a professional color scheme and include a 7-day moving average line to show the trend. Save it as a PNG image I can download.
What does this prompt do?
This prompt instructs Claude to run Python code that aggregates daily revenue from all 149,116 transactions and plots it as a line chart. The 7-day moving average smooths out daily fluctuations so you can see the overall trend more clearly.
By asking Claude to save it as a PNG, you ensure it generates a downloadable image file rather than just describing what it would look like.
- Wait for Claude to finish running its code. You'll see a chart appear in the conversation along with a downloadable PNG file.
- Download the PNG file to your computer by clicking the download option on the generated file.
Triggering code execution
Phrases like "Create a line chart" and "Save it as a PNG" signal Claude to use its code execution environment. If Claude ever responds with a text description instead of an actual chart, add "Use code execution to" at the start of your prompt.
Don't see a downloadable file?
If Claude describes the chart in text instead of generating one, resend the prompt with the phrase "Use code execution to create a line chart" at the beginning. This explicitly triggers the Python environment.
If the chart appears but there's no download option, ask Claude: "Can you save that chart as a downloadable PNG file?"
Help me get Claude to generate a downloadable PNG chart from my sales data.
Create product breakdown charts
Now that you can see the overall revenue trend, it's time to break things down. Which product categories drive the most revenue? Which individual products are flying off the shelves?
- Send this prompt to Claude to generate two charts at once:
Create a bar chart showing total revenue by product category, sorted from highest to lowest. Add data labels showing the exact values. Also create a separate chart showing the top 10 best-selling individual products by quantity.
What does this prompt do?
This prompt asks Claude to create two separate visualizations. The first bar chart ranks product categories (like Coffee, Tea, Bakery) by total revenue, with exact dollar amounts labeled on each bar.
The second chart focuses on individual products, showing which specific items sell the most units. Together, these charts reveal both the big-picture revenue drivers and the customer favorites.
- Wait for Claude to generate both charts. You should see two separate visualizations appear in the conversation.
- Download both PNG files to your computer.
Only seeing one chart?
Claude sometimes combines both charts into a single image or only generates one. If you only see one chart, send a follow-up prompt: "Can you create the top 10 best-selling products chart as a separate PNG file?"
Help me get Claude to create two separate chart files.
Create a peak hours heatmap
Knowing when customers arrive is just as valuable as knowing what they buy. A heatmap maps two dimensions at once, letting you spot the busiest times across the entire week.
- Send this prompt to Claude to generate the heatmap:
Create a heatmap showing average transaction volume by day of week (rows) and hour of day (columns). Use a color gradient from light to dark. This should help identify the busiest times.
What does this prompt do?
This prompt creates a grid where each cell represents a specific day and hour combination. Darker cells mean more transactions. You can quickly spot whether Monday mornings or Friday afternoons bring the most customers.
This type of visualization is commonly used in business to optimize staffing, plan promotions, and allocate resources during peak demand.
- Wait for Claude to generate the heatmap. You should see a color-coded grid in the conversation.
- Download the heatmap PNG file to your computer.
Heatmap looks off or hard to read?
If the color gradient doesn't make patterns obvious, ask Claude to adjust: "Can you redo the heatmap with a stronger color contrast and add numeric labels in each cell?"
If the days or hours appear in the wrong order, ask Claude: "Reorder the rows to start with Monday and the columns to start at the earliest opening hour."
Help me improve my heatmap visualization.
You now have four downloaded visualizations on your computer. Take a moment to look at each one and consider what patterns jump out.
Your visualizations are ready. Next up, you'll turn these charts and insights into a professional report that you can share with others.
Generate a Professional Report
Your visualizations tell a compelling story about the coffee shop's sales patterns. Now it's time to package everything into professional deliverables that you could share with real stakeholders.
In this step, you'll ask Claude to compile your entire analysis into a downloadable PDF report and a structured Excel spreadsheet. These are the kind of outputs that turn raw data into actionable business decisions.
In this step, get ready to:
- Generate a PDF report with executive insights and business recommendations.
- Create an Excel spreadsheet with structured data summaries across multiple sheets.
- Iterate on the outputs to refine formatting and content.
Ask Claude to synthesize findings into a report
A PDF report is the standard format for sharing data analysis with decision-makers. Claude can compile all of your findings, charts, and recommendations into a single downloadable document.
- In your existing Claude conversation, paste this prompt to generate a professional report:
Based on all the analysis we've done, create a professional PDF report titled 'Coffee Shop Sales Analysis'. Include: an executive summary, key metrics, the visualizations you created, insights about peak times and top products, and 3-5 actionable business recommendations.
What does this prompt do?
This prompt asks Claude to use code execution to compile everything from your conversation into a single PDF. Claude will run Python code using libraries like matplotlib and reportlab to generate the document.
Because you asked for "the visualizations you created," Claude will embed the charts from earlier in the conversation directly into the PDF. The business recommendations are based on the patterns Claude identified during the analysis.
- Wait for Claude to finish generating the PDF. You should see a downloadable file link appear in Claude's response.
- Click the download link to save the PDF to your computer.
Don't see a download link?
If Claude responds with text only and no downloadable file, it may not have triggered code execution. Try rephrasing your prompt to start with "Use code execution to create a professional PDF report..." to explicitly invoke the Python environment.
If Claude shows an error about a missing library, ask it to try an alternative approach. Claude's environment has multiple PDF generation libraries available.
Help me get Claude to generate a downloadable PDF file from my data analysis
Create an Excel summary spreadsheet
While the PDF is great for presenting insights, an Excel file gives stakeholders structured data they can filter, sort, and build on. Claude can generate multi-sheet workbooks with formatting and charts included.
- In the same conversation, paste this prompt to generate an Excel spreadsheet:
Create an Excel spreadsheet with three sheets: 1) Monthly revenue summary with totals and growth rates, 2) Product category breakdown with rankings, 3) Hourly traffic patterns. Include proper formatting, headers, and a chart in the first sheet.
What should I see?
Claude will run Python code using a library like openpyxl to create the .xlsx file. It should produce a downloadable link for a workbook with three separate sheets, each containing formatted tables with headers.
The first sheet (Monthly Revenue Summary) should include a chart embedded directly in the spreadsheet, showing revenue trends over time with growth rates calculated month-over-month.
- Click the download link to save the Excel file to your computer.
- Open the file in Excel, Google Sheets, or any spreadsheet app to confirm it has three sheets with properly formatted data.
Excel file won't open or looks wrong?
If the file doesn't open, make sure it downloaded completely. Some browsers require you to click a confirmation before the download finishes.
If the sheets are empty or missing formatting, ask Claude: "The Excel file is missing formatting. Can you regenerate it with bold headers, column widths adjusted to fit content, and alternating row colors?"
Help me troubleshoot my Excel file from Claude
Review and iterate on your deliverables
The first draft from any AI tool is rarely perfect. The real skill is knowing how to give specific feedback that improves the output. This is where your prompt engineering abilities come in.
- Open the PDF report on your computer and skim through each section.
- Look for areas that could be improved. Is the executive summary too long? Are the chart colors hard to read? Are the recommendations too vague?
- Back in your Claude conversation, paste this prompt to refine the report:
The executive summary is too long. Make it 3 bullet points maximum. Also change the chart colors to blue tones instead.
Why is specific feedback important?
Notice how this prompt names exactly what to change ("3 bullet points maximum") and gives a clear direction ("blue tones"). Vague feedback like "make it better" gives Claude too little to work with.
This iterative loop of generate, review, and refine is how professionals use AI tools in real workflows. Each round of feedback teaches you what to ask for upfront next time.
- Download the updated PDF once Claude regenerates it.
- Open it and confirm the executive summary is now 3 bullet points or fewer, and the charts use blue tones.
Try your own iteration
Don't stop at this one refinement. Try asking Claude to add a specific section, reword a recommendation, or change the layout. The more you practice giving targeted feedback, the faster you'll get polished outputs on the first try in future projects.
Claude not applying your changes?
If the revised PDF looks the same as before, Claude may have regenerated the document from scratch without applying your edits. Try being more explicit: "Take the PDF you just created and modify only the executive summary and chart colors. Keep everything else the same."
Help me get Claude to apply specific revisions to my report
You now have a complete set of professional deliverables: a PDF report for executives and an Excel workbook for anyone who wants to dig deeper. Next up, you'll take on a secret mission to build something even more interactive.
Secret mission
Build an Interactive Dashboard
You've created static charts and a PDF report. Now take your analysis to the next level by asking Claude to build an interactive HTML dashboard artifact. This dashboard will let you filter, explore, and compare sales data visually, all without writing a single line of code yourself.
Clean Up Your Resources
Clean Up Your Resources
This project runs entirely locally and uses free tools, so there are no ongoing costs. Decide whether to keep your downloaded files and conversation history, or clean them up.
Resources you used:
- Claude conversation at claude.ai (with uploaded CSV, analysis results, and HTML dashboard artifact).
- Downloaded files on your computer (CSV dataset, PDF report, Excel summary, PNG visualizations).
- Free accounts (Claude.ai account and Maven Analytics account).
Keep everything running
No action needed. Choose this if you want to revisit your analysis, reuse the prompts, or continue exploring the dataset.
- Your Claude conversation stays in your chat history. You can return to it anytime and continue the analysis.
- Your downloaded files (PDF report, Excel summary, PNG charts, CSV dataset) stay wherever you saved them on your computer.
- Your Claude.ai and Maven Analytics accounts remain active and free.
Pause - I'll come back to this later
Free up space and reduce clutter while keeping things you might want later.
- Move your downloaded files (PDF, Excel, PNGs, CSV) into a single folder on your Desktop so they're easy to find later.
- Your Claude conversation stays in your chat history automatically. No action needed there.
- Your free accounts stay active with no cost.
Delete - I don't want to use this again
Remove all project files and conversation history. Your free accounts can stay active since they cost nothing, or you can delete them too.
Delete your downloaded files by moving them to the Trash (macOS) or Recycle Bin (Windows). These include:
- The Coffee Shop Sales CSV file.
- The PDF report.
- The Excel summary file.
- All downloaded PNG chart images.
Delete your Claude conversation:
- Open the conversation in Claude.
- Click the conversation name at the top of the screen.
- Select Delete from the options that appear.
Optionally, delete your accounts if you no longer need them:
- Claude.ai: Visit the account deletion page via support.anthropic.com for conversation management, or search their Help Center for account deletion.
- Maven Analytics: Visit their Help Center article on account deletion at help.mavenanalytics.io and follow the documented steps.
Nice Work!
Nice Work!
You just completed a full data analysis workflow using nothing but natural language and Claude AI. From raw CSV data to professional reports and interactive dashboards, you proved that effective prompting is all you need to turn data into actionable insights.
You learned how to:
- Profiled and explored a 149,000+ row dataset using AI-powered code execution, identifying data quality issues and business questions worth investigating.
- Generated professional data visualizations (line charts, bar charts, heatmaps) that reveal sales patterns, peak hours, and top products without writing a single line of code yourself.
- Created downloadable deliverables including a PDF report with executive insights and business recommendations, and an Excel summary with multiple sheets and charts.
- Secret Mission: Built an interactive HTML dashboard with filters, dynamic charts, and a month-over-month comparison view.
Ready to quiz yourself?