Skip to main content
Lesson 13 of 14 · ChatGPT for Data Analysis

Combine Multiple Data Sources

Lesson 13 of 14 Updated November 5, 2026 Intermediate
On this page
  1. Cross-reference data for richer analysis
  2. Import multiple files
  3. Merge tables (joins)
  4. Compare budget vs. actuals
  5. Enrich with external data
  6. Handle inconsistencies between sources
  7. Multi-dimensional cross-analysis
  8. Your turn
  9. Key takeaways

Cross-reference data for richer analysis

The most powerful insights come from cross-referencing multiple sources. Sales and CRM, budget vs. actuals, web analytics and conversions: taken in isolation, each file tells only half the story. Combining them reveals patterns invisible in any single source—for example, discovering that your highest-volume customers are actually your least profitable in terms of margin.

Import multiple files

ChatGPT accepts multiple files in a single conversation. The best practice is to upload them at the start of the session and explicitly state what each contains. This saves you from answering clarification questions later and, more importantly, prevents ChatGPT from misinterpreting a file’s role.

Here are 3 files:
1. sales_q1_2026.xlsx — sales transactions
2. clients_crm.csv — customer database with sector and size
3. targets_2026.csv — targets by region and month

I will ask you to cross-reference them for a complete analysis.

Upload them one by one or all together; ChatGPT can read them all within its Python environment. The number of files allowed per conversation varies by file type, model, subscription plan, and your import quota. You can also attach files from Google Drive, OneDrive, or SharePoint when the corresponding plugins are available for your account. As in Lesson 1, keep only the columns from the CRM needed for the join.

Merge tables (joins)

A join combines two tables based on a common column: this is the core of any cross-reference. Request it by explicitly naming the key, and require immediate reporting of orphaned rows—those where the key finds no match.

Merge the sales file with the clients file
using the "id_client" column as the join key.
Show a preview of the result and flag any sales
without a matching client.

The result depends on the type of join selected, and this choice is never neutral: depending on the case, you either lose sales data or retain incomplete rows.

Join TypeBehaviorWhen to Use
Inner joinKeeps only matchesStrict analysis, no incomplete data
Left joinKeeps all rows from the primary tableEnrich sales with client info (even if client is unknown)
Outer joinKeeps all rows from both tablesIdentify discrepancies between two sources

You don’t need to know this jargon to use it. Simply describe the desired outcome, specifying how to handle unmatched cases.

I want to enrich my sales data with client info.
Keep all sales, even those where the client
is not in the CRM (mark these as "Unknown").

ChatGPT translates this request into a join—in this case, a left join, since no sales should disappear from the total; verify this in the code. Wording matters: if you had simply written “cross-reference the two files” without further precision, an inner join might have stripped your revenue figures of all clients missing from the CRM.

Compare budget vs. actuals

The most common cross-reference in performance management pits two files built by different teams against each other: targets set at the start of the year on one side, aggregated sales on the other. The twist here is the join key, which is composite—region and month—because neither column alone is sufficient to identify a row.

Cross-reference the targets file (columns: region, month, target_revenue)
with the aggregated sales file (region, month, actual_revenue).
Calculate the variance in euros and percentage for each combination.
Flag any instances where the target was not met.

Enrich with external data

A reference file allows you to add a dimension that doesn’t exist anywhere in your sales data. The classic case is the postal code: present in every order, it unlocks geographic analysis once paired with a lookup table. ChatGPT’s Python environment does not access the web: download this table from an official source, then attach it.

Here is a reference file with postal codes
and French administrative regions.
Add a "region" column to my sales data
using the postal code as the key.

The same mechanism bridges two usually siloed worlds: digital marketing and commerce. Correlating traffic with sales reveals pages that attract visitors but fail to convert—those whose audience flatters marketing reports without ever filling the order book.

File 1: Web traffic by product page (page_url, visits, bounce_rate)
File 2: Sales by product (product, revenue, quantity)

Cross-reference the two files on the product name.
Calculate the conversion rate (sales / visits) per product.
Which product has the best visits-to-sales ratio?

Handle inconsistencies between sources

Data sources rarely share the same format, and this is precisely where joins fail—silently. Three problems recur constantly. The first involves column names, which label the same information differently because two teams named them separately.

In the sales file, the column is named "client_id".
In the CRM, it is named "customer_identifier".
Perform the join by mapping these two columns.

The second concerns dates, where granularity and formatting differ from system to system. Harmonization must precede merging, never follow it: once rows are mismatched, nothing allows you to trace the error back.

Sales use the DD/MM/YYYY format.
Targets use the YYYY-MM format.
Harmonize both to month (YYYY-MM) before cross-referencing.

The third involves categorical values, where a simple difference in case or accentuation causes matching to fail, even though a human reader would see no ambiguity.

In sales, regions are uppercase (ILE-DE-FRANCE).
In the CRM, they are mixed case with accents (Île-de-France).
Normalize both before the join.

None of these precautions replaces the need for a final check. A failed join does not produce an error message: it produces a smaller table, perfectly presentable, and no one notices until the meeting. Therefore, systematically request a summary.

After the join, how many rows were lost?
How many rows found no match?
Show 5 examples of non-matches.

Multi-dimensional cross-analysis

Once sources are merged, you can cross-reference dimensions that were previously separate. This is the real benefit of all this plumbing work, and the moment it becomes visible.

Now that I have sales enriched with CRM info:
1. Revenue by client industry sector AND by product category
2. Average order value by company size (Micro, Small, Medium, Large)
3. Top 10 most profitable combinations (sector × product)

These analyses would be impossible with a single file: the sales file ignores the customer’s company size, and the CRM ignores what they buy. Cross-referencing is what finally allows you to ask the question commercial leadership cares about—which type of client buys which type of product.

Cross-reference two sources without losing rows Five steps: describe each file's role; align column names, dates, and values; join on an explicit key; check for lost rows; cross-reference dimensions. JOINS Cross-reference two sources without losing rows 1 Describe Role 2 Align Formats 3 Join Key 4 Verify Rows 5 Cross-reference Dimensions A failed join produces no error: it produces a smaller table.
Lesson method; merging datasets based on the article "Extracting Insights with ChatGPT Data Analysis" from the OpenAI Help Center (November 2026).

Your turn

Your first cross-reference.

  1. Choose two files that share a key: sales and CRM, budget and actuals
  2. Present them to ChatGPT, stating the role of each
  3. Harmonize column names, dates, and values before the join
  4. Describe how to handle unmatched rows, then run the join
  5. Request a summary of lost rows and examine five examples

Official sources: Extracting Insights with ChatGPT Data Analysis · Data analysis with ChatGPT (OpenAI Help Center)

Key takeaways

  • Import multiple files into the same conversation to cross-reference them
  • Describe the join logic in natural language, then verify the join type in the code
  • Harmonize formats (dates, names, capitalization) before merging
  • Always check row counts before and after the join
  • Multi-source cross-referencing reveals insights invisible in any isolated source