With the Saved Exports tool, you can create custom SQL queries to export information from your store's database.

In our example below, we'll export the total number of orders for each customer as well as the total number of customers who have placed orders. We'll export this data to a CSV file which can be imported into a standard spreadsheet program such as Microsoft Excel.

Accessing Saved Exports

You can follow these steps to access and create a saved export within your store's Admin Area:

  1. In your Admin Area, go to Inventory > Import/Export.
  2. Click on the Saved Exports tab.
  3. Click Add New Query.
  4. Configure your custom query and save your changes when finished.
  5. See the table below for an example query that will export the order information as described at the beginning of the article.

Use this example as a starting point for more complex queries that you can save and use with your site.

QB CUstomer ID: 0
QB Table: DB_Export
QB Title: CustomerSummary
QB Querytype: Select
qb_export_filetype: CSV
QB Query:

SELECT
CustomerID
, COUNT(*) As OrderCount
, SUM(Total_Payment_Received) As
TotOrderValue
, MIN(OrderDate) as OrderDate_First
, MAX(OrderDate) as OrderDate_Last
FROM Orders WHERE Orderstatus <>
'cancelled'
GROUP BY CustomerID
ORDER BY CustomerID ASCĀ 

Once you've configured the query in the Saved Export page, you can run the query by selecting it from your Saved Exports, selecting CSV from the File Format drop-down, and clicking Export.

Once the export is complete, you can download your exported data from the resulting page.

The exported file should contain information similar to the following table:

For more information, see the complete Import / Export user guide.

Did this answer your question?