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:
- In your Admin Area, go to Inventory > Import/Export.
- Click on the Saved Exports tab.
- Click Add New Query.
- Configure your custom query and save your changes when finished.
- 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
, COUNT(*) As OrderCount
, SUM(Total_Payment_Received) As
, MIN(OrderDate) as OrderDate_First
, MAX(OrderDate) as OrderDate_Last
FROM Orders WHERE Orderstatus <>
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.