Skip to content
← Blog
🔒 All in your browser 🚫 No uploads stored
Tutorial

How to Use the Visual Pivot Table Builder

Bill Crawford — Tutorial — February 2026 — 15 min read  ·  Last updated February 01, 2026

This tutorial walks through the Visual Pivot Table Builder from start to finish — with screenshots of every screen and three fully worked examples. By the end you'll know how to load any CSV dataset, assign fields, generate a rendered pivot table, and export the SQL script that reproduces it in SQL Server, PostgreSQL, or MySQL.

Connect on LinkedIn →

Contents
  1. What the tool does
  2. The three-step workflow
  3. Example 1 — Sales Revenue by Region and Quarter
  4. Example 2 — Headcount by Department and Job Level
  5. Example 3 — Order Count by Category and Status
  6. Understanding the SQL output by dialect
  7. Pro tips and common mistakes

Follow along. Open the tool in a new tab and build as you read.

Open Visual Pivot Builder ↗

What the Tool Does

A pivot table rotates data. Instead of reading through hundreds of rows to compare East vs West revenue by quarter, a pivot puts each region on its own row and each quarter as a column — the comparison is instant. The challenge has always been that writing pivot SQL by hand is tedious, especially when you have to manually list every column value.

The Visual Pivot Builder solves this two ways at once:

  1. It shows you the pivot table rendered visually — so you can immediately see if your field assignments make sense before touching your database
  2. It generates the SQL script — specific to your data, with the actual column values already hardcoded, ready to paste and run

The SQL output supports four dialects. SQL Server gets the native PIVOT operator. PostgreSQL, MySQL, and Generic SQL get equivalent CASE WHEN conditional aggregation — because those databases don't have a PIVOT keyword.

The Three-Step Workflow

The tool is organized into three tabs across the top of the tool card. You move through them in order, but can always click back to any earlier step.

dataconversioncenter.com/sql/builders/visual-pivot/
1 Load Data 2 Configure Fields 3 Pivot & SQL ACTIVE ← click any tab to jump
The three-step tab strip at the top of the tool. Step 1 is active (blue underline). Completed steps show a green ✓ badge.

Example 1 — Sales Revenue by Region and Quarter

Example 1 Sales by Region

Goal: Given a flat table of regional sales transactions, build a pivot that shows total revenue for each region (rows) broken out by quarter (columns).

Dataset: 24 rows — 4 regions × 3 quarters × 2 products. Columns: Region, Quarter, Product, Revenue, Units.

1
Load the Sales data

Click the 📈 Sales by Region sample button below the upload zone. The CSV data loads into the paste area instantly. You'll see a message: "Sample data loaded — click Parse Data to continue."

Step 1 — Load Data
ℹ Sample data loaded — click Parse Data to continue. 📄 Drop a CSV file here or click to browse — .csv, .tsv, .txt Try a sample: 📈 Sales by Region 👥 Headcount 🛒 Orders ↑ click this OR PASTE DATA BELOW Region,Quarter,Product,Revenue,Units East,Q1,Widget A,12400,310 East,Q1,Widget B,8900,225 East,Q2,Widget A,14700,368 East,Q2,Widget B,9600,240 West,Q1,Widget A,15200,380 ... Data appears here after clicking the sample button Parse Data → Clear
Step 1 after clicking "Sales by Region". The CSV data fills the paste area. Click Parse Data → to continue.

Click Parse Data →. The tool reads all 24 rows, detects 5 columns, and shows a data preview table. The step 1 tab turns green (✓) and the tool jumps to step 2 automatically.

Step 1 — After parsing: data preview
✓ Parsed 24 rows and 5 columns. DATA PREVIEW REGION QUARTER PRODUCT REVENUE UNITS EastQ1Widget A12400310 EastQ1Widget B8900225 EastQ2Widget A14700368 … 21 more rows 24 rows 5 columns
After parsing: a 5-row preview confirms the data loaded correctly. The tool moves to Step 2 automatically.
2
Configure the pivot fields

Step 2 shows the settings row at the top and the field configuration below. The Available Fields panel on the left lists all 5 detected columns — each with a type badge (abc for text, 123 for numeric).

Step 2 — Configure Fields
TABLE NAME sales_data SQL DIALECT SQL Server (T-SQL) GRAND TOTALS Rows & Columns AVAILABLE FIELDS Region abc Quarter abc Product abc Revenue 123 Units 123 → click to assign ⇔ Row Field groups rows Region × ⇕ Column Field values become headers Quarter × ∑ Value Field what to aggregate Revenue × Aggregate: SUM ▾ ⚡ Build Pivot ← Back Reset Fields
Step 2 with all three fields assigned: Region → Row Field (amber), Quarter → Column Field (green), Revenue → Value Field (blue) with SUM aggregate.

Here's what to click for this example:

  1. Table Name: type sales_data (or leave as YourTableName — this only affects the SQL output)
  2. Row Field: click Region in the field bank — it jumps into the amber Row Field zone
  3. Column Field: click Quarter — it jumps into the green Column Field zone
  4. Value Field: click Revenue — it jumps into the blue Value Field zone
  5. Aggregate: leave as SUM — we want total revenue per cell

💡 Tip — how the type badges help: Fields tagged 123 are numeric (Revenue, Units). Fields tagged abc are text (Region, Quarter, Product). For SUM and AVG, the Value Field must be a 123 field. For COUNT or COUNT DISTINCT, any field works.

Click ⚡ Build Pivot.

3
Read the results

Step 3 shows the pivot table on the left and the SQL script on the right. The pivot summarises all 24 rows into a 4×3 grid — four regions × three quarters — with a Grand Total column and row.

Step 3 — Pivot Table output
✓ Pivot built — 4 row values × 3 column values. 24 source rows processed.
The green success banner confirms the pivot dimensions — 4 regions × 3 quarters, all 24 rows processed.

The rendered pivot table looks like this:

Region Q1 Q2 Q3 Grand Total
East21,30024,30019,00064,600
North16,50019,30017,30053,100
South14,30016,70014,80045,800
West26,50031,90028,50086,900
Grand Total78,60092,20079,600250,400

Notice that West is the top-performing region every quarter and Q2 is the strongest quarter across all regions — insights that would have taken minutes to spot by scanning the raw 24 rows, but are immediately obvious in the pivot.

4
Copy the SQL

The SQL script panel on the right of step 3 shows the ready-to-run query. For SQL Server it uses the native PIVOT operator with the actual quarter values (Q1, Q2, Q3) already hardcoded:

-- Visual Pivot Builder — DataConversionCenter.com
-- Dialect: SQL Server T-SQL | Pivot: Region × Quarter
-- Aggregate: SUM(Revenue) | 3 pivot columns

WITH source_data AS (
  SELECT
    [Region],
    [Quarter],
    [Revenue]
  FROM [sales_data]
)
SELECT
  [Region],
  COALESCE([Q1], 0) AS [Q1],
  COALESCE([Q2], 0) AS [Q2],
  COALESCE([Q3], 0) AS [Q3]
FROM source_data
PIVOT (
  SUM([Revenue])
  FOR [Quarter] IN (
       [Q1],
       [Q2],
       [Q3]
  )
) AS pivot_result
ORDER BY [Region];

Click PostgreSQL in the dialect row to instantly switch to CASE WHEN conditional aggregation. Click Copy SQL to copy it to your clipboard.

Example 2 — Headcount by Department and Job Level

Example 2 Headcount & Salary Analysis

Goal: Pivot an HR dataset to show total headcount per department (rows) broken out by job level (columns). Then switch to SUM(AvgSalary) to compare salary spend.

Dataset: 24 rows — 4 departments × 3 job levels × 2 years. Columns: Department, JobLevel, Year, Headcount, AvgSalary.

Click the 👥 Headcount sample button, then Parse Data →. When step 2 opens, configure:

Step 2 — HR Headcount configuration
AVAILABLE FIELDS Department JobLevel Year 123 Headcount ⇔ Row Field Department × ⇕ Column Field JobLevel × ∑ Value Field Headcount × Aggregate: SUM ▾ Used fields fade in the bank (shown at 40% opacity above)
Used fields fade in the Available Fields bank. Only "Year" remains unassigned and fully visible.

Click ⚡ Build Pivot. The result:

Department Junior Mid Senior Grand Total
Engineering907941210
Marketing39301685
Operations1146930213
Sales665124141
Grand Total309229111649

Now try switching the Value Field from Headcount to AvgSalary with AVG aggregate. Click ✎ Edit Config (bottom of step 3) to go back, remove Headcount from the Value zone and click AvgSalary, change the aggregate dropdown to AVG, then Build Pivot again. You'll see average salary spend per department per level — a completely different analysis from the same dataset, with two clicks.

💡 Key insight: The Year field was in the data but left unassigned. The tool aggregated across both 2023 and 2024 automatically — SUM adds both years' headcount together. If you assigned Year as the Column Field instead, you'd see a year-over-year comparison instead of a level breakdown.

Example 3 — Order Count by Category and Status

Example 3 Order Status Breakdown

Goal: Show how many orders in each product category (rows) are Completed vs Returned (columns). This uses COUNT instead of SUM — demonstrating that the aggregate choice matters as much as the field choice.

Dataset: 18 rows — 3 categories × 2 statuses × 3 months. Columns: Category, Status, Month, OrderCount, Revenue.

Click the 🛒 Orders sample button, Parse Data →, then configure:

⚠️ SUM vs COUNT — know the difference: This dataset already has a pre-aggregated OrderCount column (e.g. 142 electronics orders in Jan). If you used COUNT, the tool would count the number of rows per cell (which would be 3 — one per month), not the actual order volumes. Use SUM to total up pre-aggregated counts. Use COUNT when each row represents one event and you want to know how many events occurred.

Result:

Category Completed Returned Grand Total
Clothing955831,038
Electronics44536481
Home26721288
Grand Total1,6671401,807

The return rate is immediately visible: Clothing has 83/1,038 = ~8%, Electronics has 36/481 = ~7.5%, Home has 21/288 = ~7.3%. All similar, but Clothing is slightly higher. This would take several formulas to calculate in Excel — the pivot surfaces it in one click.

Step 3 — SQL output panel with dialect buttons
📄 SQL SCRIPT Copy SQL SQL Server PostgreSQL MySQL Generic SQL -- Visual Pivot Builder — DataConversionCenter.com -- Dialect: SQL Server T-SQL | Pivot: Category × Status -- Aggregate: SUM(OrderCount) | 2 pivot columns WITH source_data AS ( SELECT [Category], [Status], [OrderCount] FROM [YourTableName] ) SELECT [Category], COALESCE([Completed],0) ... (full script continues — click Copy SQL to get the complete query)
The SQL panel. Dialect buttons (SQL Server active in blue) switch the output instantly. The table name shows "YourTableName" — replace it with your actual table in the query or back in the Table Name field in Step 2.

Understanding the SQL Output by Dialect

The same pivot logic generates very different SQL depending on which dialect button you choose.

SQL Server (T-SQL) — native PIVOT operator

SQL Server has a built-in PIVOT operator. The tool wraps your data in a CTE, then applies the pivot with an IN clause listing the exact column values found in your data — in this case [Completed] and [Returned]. This is the most readable form and produces the cleanest execution plan.

PostgreSQL — CASE WHEN conditional aggregation

PostgreSQL has no PIVOT keyword. The equivalent is one SUM(CASE WHEN status = 'Completed' THEN order_count END) expression per output column. The tool generates one CASE expression per distinct column value found in your data, then wraps each in COALESCE(…, 0) to replace NULLs with zero.

-- PostgreSQL equivalent (generated automatically)
SELECT
  "Category",
  COALESCE(SUM(CASE WHEN "Status" = 'Completed' THEN "OrderCount" END), 0) AS "Completed",
  COALESCE(SUM(CASE WHEN "Status" = 'Returned'  THEN "OrderCount" END), 0) AS "Returned"
FROM "YourTableName"
GROUP BY "Category"
ORDER BY "Category";

MySQL — same CASE WHEN pattern with backtick quoting

MySQL uses backtick identifier quoting instead of double-quotes or brackets. The logic is identical to PostgreSQL — CASE WHEN per column. The generated SQL uses backticks throughout so it runs without modification in MySQL Workbench, DBeaver, or any MySQL client.

Generic / ANSI SQL

The Generic option generates the most portable form — double-quote identifiers, standard CASE WHEN, no database-specific functions. Works in DuckDB, SQLite, Snowflake, BigQuery, and most other ANSI-compatible engines with minor tweaks.

Pro Tips and Common Mistakes

Tip 1 — Use sample data first to understand the workflow

Before loading your own data, click through one of the three sample buttons (Sales, Headcount, Orders) and build the pivot. It takes under a minute and makes the field assignment step much more intuitive when your own data arrives.

Tip 2 — The Column Field controls how wide your pivot gets

The Column Field should be the field with a manageable number of distinct values — ideally 3–15. If you accidentally put a high-cardinality field (like a customer name or order ID) in the Column Field, you'll get hundreds of columns. If this happens, click ✎ Edit Config at the bottom of step 3, swap it out, and rebuild.

Tip 3 — Your table name only affects the SQL

The Table Name field defaults to YourTableName. This name appears in the FROM clause of the generated SQL — it has no effect on the visual pivot table. You can leave it as-is while exploring, then fill in your actual table name before copying the SQL to run in your database.

Tip 4 — COUNT vs SUM — which one to use

Use COUNT when each row in your source data represents one event and you want to know how many events happened per cell. Use SUM when your data already contains a numeric metric (revenue, quantity, headcount) that you want to total up. A common mistake is using COUNT on a dataset that has pre-aggregated counts — you'd get the number of rows rather than the sum of those counts.

Tip 5 — Unassigned fields are just ignored

You don't have to assign every field. In Example 2, Year and AvgSalary were left unassigned and the tool ignored them entirely when building the pivot. The SQL only references the three fields you assigned — which is exactly what you'd write by hand too.

Tip 6 — Paste data from Excel with Ctrl+C

When you copy a range of cells in Excel or Google Sheets with Ctrl+C and paste into the text area, the clipboard contains tab-separated values — and the parser handles this automatically. You don't need to export to .csv first. Just copy your spreadsheet range and paste directly.

Ready to build your own pivot? Open the tool and load your data in under a minute.

Open Visual Pivot Builder →

Related Tools & Articles

BC
Bill Crawford
Founder, Data Conversion Center

Bill Crawford is a data systems developer and technical founder with over 30 years of professional experience in accounting, finance, and business operations.

He holds a Bachelor's degree in Accounting and has spent more than three decades working within financial and operational environments. Over the past 10 years, he has been heavily involved in the development, implementation, and refinement of financial and enterprise data systems for both Fortune 500 companies and smaller organizations.

His work bridges finance and technology — combining deep domain knowledge in structured reporting and accounting workflows with hands-on SQL development and database architecture experience.

Bill founded DataConversionCenter.com to build practical, browser-based tools that simplify complex data challenges, including:

Rather than focusing on theoretical examples, his tools and articles are informed by real-world challenges encountered in enterprise reporting systems, financial databases, and operational data environments.

Professional Background

Bill's mission is to reduce friction in data workflows — particularly for professionals working with structured financial, operational, and reporting data.