Claude has an amazing analysis tool that gives you insight into swathes of data, revealing valuable information that might otherwise go unnoticed. This tool helps you make informed decisions and uncover hidden patterns or trends that can drive strategic action.
More precisely, Claude's analysis tool lets you write and run JavaScript code directly within Claude.ai, giving you real-time insights and data analysis. This article will show you how to turn on the feature, use it properly, and take advantage of its capabilities for different tasks.
The tool is mainly useful for two things:
- Running calculations and executing code
- Analyzing and visualizing CSV data
We will perform analysis and visualization for this tutorial. You will learn how to create sample sales data to test the Claude Analysis tool by using ChatGPT. You can use your dataset instead of creating sample data. Keep in mind that the dataset should be large enough to contain at least 500 or more rows and more than 10 columns. It also shows you how to design Claude's analysis tool.
By the end of this tutorial, you’ll find how to:
- Create sample sales data for the test
- Design an analysis tool in Claude
- Share data visualizations for others to view
Requirements:
- Paid ChatGPT account
- Paid Claude account
- A Google account (for Google Sheets)
Let’s get started!
Step 1 - Create sample sales data for the test
Claude’s analysis tool is for large datasets. For smaller ones, you can use Claude artifacts. We are using ChatGPT to create sample sales data for the Claude analysis tool.
In ChatGPT, write the following prompt to generate a relatively large sales data set.
Prompt:
Create a large dataset for imaginary chocolate coffee biscuit sales in California. Include detailed data for San Francisco, Santa Cruz, Los Angeles, and San Diego. The revenue is in millions, and sales are more than 10000 monthly. It should be at least 400 rows and 10 columns. Include sales data from 2020 to December 2024. Specify sales per month starting from December 2020. Extend it with a monthly record. Provide a CSV file.

ChatGPT didn’t give us a large dataset, so we will extend the table to make it larger in Google Sheets. Copy the data in a Google sheet first.

Select all the rows and columns and extend it to 400 rows.

Download the CSV file. It will be used to perform analysis in Claude. Click File and go to Download. Select ‘Commas Separated Values (.csv).

Now that we have a .csv file with a relatively large data set let’s go to Claude and start using the analysis tool.
Step 2 - Create an analysis tool in Claude
Now comes the interesting part. The Claude analysis tool can perform various types of analysis, such as univariate, bivariate, and multivariate analysis. It simplifies the process with natural language commands.
We will show you all three analyses for the data we generated in step 1.
Use the following prompt to generate a univariate analysis.
Prompt:
Describe the distribution of transaction amounts.
Click the paper clip icon at the bottom of the text input box and attach the .csv file you generated in step 1.

Claude created a bar chart for the distribution.

Hover your mouse over the bars, and the item count for each variation will be shown.
You can use other univariate prompts to test the analysis tool's real power. Another example is to show the revenue column's summary stats.
Prompt:
Show summary statistics for the revenue column.

Claude calculated the statistics and created a graph showing the Q1, Q2, and Q3 revenue. This visualization helps to see both the numerical summary and the visual distribution of the revenue data. You can hover over any point to see its exact value. The close alignment of the mean and median lines visually confirms the symmetrical distribution we observed in the statistics.
This was a univariate analysis. Let’s see if it can create a scatter plot with product price and sales quantity.
Prompt:
Create a scatter plot with product price on the x-axis and sales quantity on the y-axis.
.gif)
That came out very good. It showed that higher prices are associated with periods of higher demand. It also indicated that other factors (like seasonality or market growth) might influence both price and sales volume. The specific market conditions or product type might affect the relationship.
Moving on, we will ask it to generate a multivariate model using pairwise plots.
Prompt:
Use pairwise plots to check relationships between several numeric columns.

The visualization includes both scatter plots (upper triangle) and correlation coefficients (lower triangle), with variable names on the diagonal. You can hover over any point in the scatter plots to see the exact values.
Once you’re done with the exploration phase, Claude’s full potential shines through as you start working on predictive and inference models. The natural language patterns stay the same, but now you can create, compare, and fine-tune more complex model structures. For example, you can make a neural network for price prediction, which means building a model that uses complex patterns in data to forecast prices. Comparing its accuracy to linear regression involves testing both models and seeing which predicts prices more accurately. The goal is to determine if the neural network provides better results than the simpler linear regression model.
Prompt:
Create a neural network for price prediction and compare its accuracy to linear regression.

The visualization helps us understand the model predictions align with actual values (points closer to the red line indicate better predictions). Any systematic bias in the predictions (points consistently above or below the line). The model's overall accuracy through visual inspection and numerical metrics is good.
Another way to do a model comparison is to use a decision tree classifier to categorize sales trends over a 5-year period. We used the following prompt.
Prompt:
Use a decision tree classifier to categorize sales trends over the period of 5 years.

As always, hover the cursor over the graph, and you can interact with the data.
You can also adjust the output by refining its variables when working with the Claud analysis tool. As the models get built, Claude breaks down each step and shares the key metrics to see if they’re hitting the business targets. With interactive visuals, it’s super easy to spot any issues with the models and tweak them as needed.
Prompt:
Balance precision and recall because we want high coverage and accuracy.

That’s more like it. We can now see a more balanced approach to classification.
You can use the following prompts to adjust the accuracy of the analysis tool:
- Increase model sensitivity to reduce false negatives
- Improve specificity by 10% to lower incorrect fraud predictions.
Step 3 - Share data visualizations for others to view
Now that you have generated many graphs, histograms, and scatter plots, you might want to share them with your colleagues to help with sales projections and other decisions.
Click the ‘Publish’ at the bottom of the visuals window.

A new window appears. Click ‘Publish & Copy Link.’

Click ‘Copy link’ and share it with others.

You can unpublish it as soon as others have viewed the data by clicking the unpublish button.
There you have it, folks. Claude’s analysis tool is a total time-saver, especially when you’re stuck making those never-ending reports for the execs. It can whip up any kind of chart or graph you need while also putting together a detailed analysis that’s perfect for reports. It really helps you streamline the process and focus on the important stuff rather than getting bogged down in the details.