Editorial illustration of a CSV folder and receipt rows inspected for duplicate sales records.

Analyze a Sales CSV With ChatGPT Without Double-Counting Orders

A sales export can produce a convincing report with the wrong total. One repeated row, a cancelled order and an unclear refund column are enough to change the story. Before asking ChatGPT which channel performed best, decide what each row represents and which amounts belong in the calculation.

This walkthrough uses a small fictional dataset you can inspect yourself. It shows how to define the calculation, request a data-quality check and reconcile the result. The arithmetic was checked independently with Python; the example is not a recorded test of ChatGPT’s responses.

Start with the metric and the meaning of a row

For this exercise, one unique row represents one order. The report covers these listed orders only, all in USD. The sales column is the order’s amount after discounts, excluding tax and shipping. Refund is the amount already attributed to that order in this exercise.

The exercise rule is to include paid orders, exclude cancelled orders, remove one known exact duplicate and subtract listed refunds once. This creates an illustrative after-refund sales total. It is not a universal accounting definition or a substitute for understanding your store’s export.

order_id,status,channel,sales_usd,refund_usd
A101,paid,email,60,0
A102,paid,paid_social,40,10
A102,paid,paid_social,40,10
A103,cancelled,email,30,0
A104,paid,organic_search,75,0
A105,paid,,25,5

You can copy this text into a plain-text file named example-sales.csv. The blank channel on A105 is deliberate. Do not fill it with “direct” just because you need a tidy label. Unknown information should remain distinguishable from an observed channel.

Prepare the real export before uploading

Keep the original file unchanged and work on a copy. Remove names, addresses, payment details and other personal information that the analysis does not need. Preserve non-personal record IDs so you can trace a total back to a row. Use a tool and account permitted for your business data.

Prefer a structured export over a screenshot of a spreadsheet. OpenAI’s guidance recommends descriptive headers and one record per row. An image can make exact values harder to recover, while a file with several unrelated tables introduces ambiguity about what belongs in the calculation.

Source: OpenAI.

Look for currency, timezone, date boundaries and the meaning of each status. In a line-item export, one order may legitimately occupy several rows. In an event export, an order might have separate sale and refund events. Repeated order IDs are not automatically duplicates.

Upload the file and ask for inspection first

Attach the CSV using the available file control in ChatGPT. OpenAI lists CSV among supported spreadsheet formats, with availability and limits depending on the account and experience. A successful attachment alone does not prove that every row was analyzed.

Source: OpenAI.

Inspect example-sales.csv before calculating performance. State the column names and total data-row count. Show exact duplicate rows, repeated order IDs, blank fields and status values. Do not remove or relabel anything yet. Explain whether the file contains orders, line items or events based on the supplied definition.

For the example, you should be able to confirm six data rows, a repeated exact A102 row, one cancelled A103 row and a blank channel for A105. If the inspection reports five rows before explaining a deletion, ask for the original row count and the transformation log.

This first pass makes cleanup reviewable. It prevents an assistant from silently deciding that a missing channel is direct traffic or that a cancellation should be treated as a completed sale.

Supply the rules, then request a reconciliation

For this exercise, each unique record is one order in USD. Keep only paid orders. Remove one copy of the exact duplicate A102 record, retaining one. Do not deduplicate on channel, amount or order ID alone in other datasets. Label the blank channel as unknown for grouping, while preserving its original value in the cleaned copy. Sum sales_usd, sum refund_usd, and calculate after_refund_sales_usd = sales_usd - refund_usd. Show retained IDs, excluded rows and totals by channel and overall. Return the calculation method and a cleaned copy without altering the original.

The correct retained IDs are A101, A102, A104 and A105. One duplicate row and one cancelled row are excluded. Four paid orders remain.

ChannelOrdersSales USDRefunds USDAfter-refund sales USD
email160060
paid_social1401030
organic_search175075
unknown125520
Total420015185

The check is small enough to reproduce manually: 60 + 40 + 75 + 25 = 200; refunds are 10 + 5 = 15; 200 − 15 = 185. Counting the duplicated paid row would inflate both sales and refunds. Excluding its refund but keeping its sale would create another error.

Review the method, not only the final number

When ChatGPT uses Python, request the code or analysis details and inspect the filtering and grouping. OpenAI’s documentation explains that some data-analysis tasks run Python calculations, and recommends reviewing the method and assumptions.

Check whether the method kept one A102 record, removed A103, preserved A105 and subtracted refunds only once. Ask for totals before and after each cleaning step if the result is difficult to reconcile.

A table can be copied into another application for a second check. OpenAI also documents working with uploaded CSV tables and selecting or naming columns for follow-up questions. You do not need an elaborate dashboard to verify six rows.

Source: OpenAI.

Know what the result cannot tell you

Organic search has the largest after-refund total in this tiny example. That observation does not establish the best acquisition channel. There is no ad spend, traffic count, margin, attribution method or representative history in the file.

Do not calculate ROAS without an appropriate spend figure and a defined revenue measure. If those inputs are available, this ROAS guide explains the basic ratio. Keep the attribution period and channel definitions consistent before comparing it with an advertising dashboard.

Refund timing also matters. A real export may show refunds processed this week for orders placed last month. Decide whether you are reporting order-cohort results or activity during a period. Combining those approaches can make two correct reports look inconsistent.

Turn a checked table into a useful report

Ask for a brief narrative with three parts: what the file shows, which limitations matter and which question needs another source. For this example, “A105 lacks a recorded channel” is supported. “Improve email creative because it is underperforming” is not supported by four orders.

Keep the cleaned file, rule sheet and reconciliation together. Record the export time and reporting period when you repeat the workflow with real data. If a later export changes an order’s status or refund amount, rerun the calculation rather than reusing the earlier narrative.

For a related qualitative task, this customer-review analysis guide uses source IDs to keep interpretations attached to evidence. The same habit makes a sales report easier to trust: every important number should have a path back to its input.

Leave a Comment

Your email address will not be published. Required fields are marked *