Ask Your Data Questions in Natural Language
On this page
Query Your Data Like You’re Talking to a Colleague
ChatGPT’s biggest advantage for data analysis comes down to one thing: it understands your questions in plain English. You don’t need SQL, Python, or a three-level nested Excel formula. Just describe what you’re looking for exactly as you would tell a colleague analyst looking at the same file, and ChatGPT translates your intent into executable code. This shift is real, and it changes the nature of the work: your effort moves from syntax to formulating the right question.
The Principle: From Natural Language to Python Code
When you ask a question about your data, here’s what happens behind the scenes:
This code isn’t a black box: you can display it, review it, and ask ChatGPT to adjust the method. Note that the Python environment doesn’t have web access: if your analysis needs external data, import it or connect a source.
Types of Questions You Can Ask
Summary questions help you get a feel for the file before diving into details: “How many rows and columns does this file have?”, “Give me a general overview of the data,” or “What columns are available and what are their types?” These questions prevent you from starting an analysis that assumes a granularity your data doesn’t have—you can’t calculate average basket size per customer if the file is already aggregated by region.
Next come aggregation questions, which condense thousands of rows into actionable numbers: “What’s the total sales by product category?”, “What’s the average basket size by month?”, “How many unique customers per quarter?” This is the core of monthly reporting, and often half the work you’ll be asked to do.
Filtering questions then isolate a relevant subset—“Show me only sales over €10,000,” “Which products had no sales in March?”, “List customers in the Île-de-France region”—while ranking questions order data to highlight extremes: “Who are the top 10 salespeople?”, “Rank regions by revenue in descending order,” “Which month performed best?” In practice, a serious analysis chains all four types: you summarize, aggregate, filter out the anomaly you spotted, then rank to prioritize action. You can also select rows, columns, or cells in the interactive table preview, then ask your question about that selection only—the most frequent value in a column, the average of a few cells.
Formulating Effective Questions
The quality of the answer depends directly on how clear your question is. Your first reflex should be to name columns rather than speak in generalities. “Analyze sales” leaves ChatGPT guessing which column holds the amount; this formulation leaves no room for interpretation:
Calculate the total of the "amount_incl_tax" column grouped by "region"
and sorted from highest to lowest.
Your second reflex is to specify the output format you want. Otherwise, you’ll get a written response when you needed a table to paste into your report, and you’ll lose the time you saved on calculation by reformatting:
Give me the result as a table with these columns:
region, total sales, number of transactions, average basket size.
The third, often overlooked, is to provide business context the file doesn’t contain. ChatGPT doesn’t know that certain rows shouldn’t be included in the calculation:
The "status" column contains "approved", "pending", and "cancelled".
Only include approved orders.
Without this clarification, your cancelled orders inflate revenue, and the error goes unnoticed: the result still looks perfectly plausible. This is the type of mistake that slips through an executive meeting undetected.
Iterating on Results
Data analysis is rarely linear, and you’re not expected to find the right question on the first try. You start by asking for total revenue by month, notice a dip in February, then ask why that drop occurred. If the answer stays vague, you filter to the “premium” category and recalculate, then compare with the same period last year to determine whether it’s known seasonality or an incident.
ChatGPT keeps the conversation context and the uploaded file, so each question builds on previous ones. This makes progressive exploration possible: the February dip, once isolated to the premium segment, might be explained by a single major client switching to a competitor—a conclusion unreachable from the first question.
More Thinking for Complex Analyses
Some questions can’t be solved with a simple aggregation. Cross-correlations, multi-source analyses, nuanced interpretations: whenever multi-step reasoning is needed, choose a higher thinking level in ChatGPT’s selector—High or Extra High depending on your plan, or the Think button on Free and Go. The extra thinking helps consider factors that might explain a link between two variables before concluding causation, spot subtle patterns—a seasonality shifted by three weeks, a segment declining quarter after quarter—and build recommendations from the calculated numbers. No setting, however, turns correlation into causation: that’s where your domain knowledge, and sometimes a test, decides.
Your Turn
Your first questions.
- Import a file you know well
- Ask one question from each family: summary, aggregation, filtering, ranking
- Rephrase one of them by naming columns and specifying output format, then compare the two responses
- Add a business rule—for example, exclude cancelled orders—and measure the difference
- Display the code for a calculation and verify it manually on two or three rows
Official sources: Data analysis with ChatGPT · Extracting Insights with ChatGPT Data Analysis (OpenAI Help Center) · Prompting (ChatGPT documentation)
Key Takeaways
- Ask questions in plain English; ChatGPT translates them into code
- Be specific: name columns, specify filters, indicate your desired format
- Iterate within the same conversation to deepen your analysis
- Raise the thinking level for multi-step analyses
- Always verify results—ChatGPT can misinterpret a column