The Shopify orders CSV: one row per item, blank order fields, and how to make it one row per order
The orders export lists every line item on its own row and writes the order-level columns — order name, email, financial status, totals — only on the first row of each order, leaving them blank on the rest. Sort it, filter it or pivot it and the line items lose their order. The fix is to fill those columns down before doing anything else, which the query below does over the sample file, and the phone numbers and amounts come through as written because nothing is retyped on the way.
What the export looks like
An order with three items is three rows. The first carries the order name, the email, the financial and fulfilment status, the timestamps and the totals; the second and third carry only the line item columns — quantity, name, price, SKU — and nothing else. It is a faithful picture of the order, and it is the wrong shape for a spreadsheet, where every row is expected to stand on its own.
The timestamps carry a timezone offset, such as -0500, that Excel turns into text or a date depending on its mood; phone numbers start with + or 00 and lose it the moment Excel reads them as numbers; and a store with many orders receives the export by email as a zip rather than as a download.
Fill the order columns down
The SQL console here opens with a query that numbers the rows in file order and carries every order-level column — name, email, statuses, currency, totals, phone — forward onto every line item beneath it, with the line-item columns left as they are. Run it over the sample file to see the shape, then drop your own export and change the table name in the query to the name the console gives your file. The result is one row per line item with its order beside it — the form a pivot, a filter or a merge with another file needs.
Every value stays text: 004915112345678 keeps its zeros, +14155550100 keeps its plus, and the totals are the digits Shopify wrote. Download the result as CSV or as an Excel workbook of text cells.
One row per order instead
When the line items do not matter, keep only the rows where the order name is filled: the filter tool here does that in one rule, and the result has one row per order with the totals Shopify already computed. Do not sum the line item prices to check them — discounts, shipping and taxes live in the order columns, not in the items.
To compare two exports — this month against last, or before and after a bulk edit — the compare tool lists the orders added, removed and changed, cell by cell.
The sample file
Name,Email,Financial Status,Paid at,Fulfillment Status,Currency,Subtotal,Total,Lineitem quantity,Lineitem name,Lineitem price,Lineitem sku,Phone
#1001,amira.khan@example.com,paid,2024-01-31 10:15:22 -0500,fulfilled,USD,45.00,52.50,1,Blue mug,20.00,MUG-0001,+14155550100
,,,,,,,,2,Tea sampler,12.50,TEA-0012,
#1002,tomasz.nowak@example.com,paid,2024-01-31 11:02:03 -0500,unfulfilled,USD,20.00,27.50,1,Blue mug,20.00,MUG-0001,004915112345678
#1003,chen.wei@example.com,refunded,2024-02-01 09:40:11 -0500,fulfilled,USD,37.50,45.00,3,Tea sampler,12.50,TEA-0012,+8613800138000
,,,,,,,,1,Gift card,0.00,GIFT-0100,
#1004,priya.raman@example.com,paid,2024-02-02 16:20:45 -0500,fulfilled,USD,60.00,67.50,2,Notebook,30.00,NB-0007,+919876543210
,,,,,,,,1,Blue mug,20.00,MUG-0001,Obviously made-up data, small enough to read. Download it and drop it on the tool to see the fix before trying your own file.
Questions
- Why are most of the cells in my Shopify export blank?
- Because each order takes one row per line item, and the order-level columns are written only on the first. The blanks are the second and later items of an order, not missing data.
- Can I get one row per order?
- Yes. Filter to the rows where Name is not blank and you have one row per order with the totals Shopify computed. The line items are on the other rows; fill the order columns down first if you need both.
- Why did the phone numbers lose their leading zeros or plus?
- Excel read them as numbers. Every tool here keeps them as text, so 004915112345678 and +14155550100 come out exactly as the export wrote them, in the grid and in the download.
- What is the -0500 after the dates?
- The store’s timezone offset from UTC, written on every timestamp. It stays in the value here; if you want a plain date, the SQL console can cut it off with one expression.
- Do I have to change the query for my own file?
- Only the table name: the console names each file’s table after the file, shown in the sidebar, and the query as written names the sample. The column names are Shopify’s own and match a standard orders export.
- Is my export uploaded anywhere?
- No. The query that fills each order down onto its line items runs inside this page, so the customer names, emails and phone numbers in your export stay on your machine.