My Store Database scheme / analytics

My Store Database scheme / analytics

hughespc
Visitor
3 0 0

HI,
am trying to produce a report of the product levels of the top 50 selling items. The examples in the shopify documentation do not appear to work. Products dataset queries give various error when pasted into my shopifyql.
The analytics report “Sell-through rate by product” is what would like but limited to top 50 items, however the shopifyql is not shown.
Spent time with customer care but no joy.
Looking for inventory level but not see an inventory table in my store.

How do I find my database schema as documentation does not appear to match my data.  

Replies 5 (5)

xerioniz
Shopify Partner
1 0 0

 


Hi ,

I understand your challenge—ShopifyQL can be tricky when the documentation examples don’t match real-world store data. Based on your request, here’s a structured approach to generating a report for the top 50 selling items along with their inventory levels:

Step 1: Understanding Your Data Source

Shopify Analytics provides built-in reports, but these often lack customization options like filtering to a top 50 list. The "Sell-through rate by product" report is useful, but as you noted, ShopifyQL for that report isn’t visible.

ShopifyQL queries typically pull data from the Products, Orders, and Inventory tables (when available). However, depending on your plan and app setup, you might not see an explicit "Inventory" dataset. Instead, inventory data is usually linked through the Product Variants dataset.

Step 2: Retrieving the Top 50 Best-Selling Products

If you're on Shopify Plus or using ShopifyQL through an advanced analytics tool (like a data warehouse or third-party app), you can try querying:

FROM sales  
SELECT product_title, variant_title, SUM(quantity) AS total_sold  
GROUP BY product_title, variant_title  
ORDER BY total_sold DESC  
LIMIT 50  

This query fetches the top 50 products based on total sales.

Step 3: Getting Inventory Levels

Shopify does not directly expose an Inventory Table, but inventory data can be retrieved through the Product Variants dataset:

FROM product_variant  
SELECT product_title, inventory_quantity  
WHERE product_title IN (SELECT product_title FROM sales ORDER BY SUM(quantity) DESC LIMIT 50)  

This links inventory data to your top-selling products.

Alternative Solutions

Since Shopify’s built-in reporting has limitations, you might consider:

  • Use a Shopify App like Report Pundit or Better Reports for deeper data analysis.
  • Exporting data to Google Sheets or a BI tool via an app or API for custom analysis.

If you're looking for a fully automated, customized solution to generate this report dynamically, I offer Shopify store optimization services, including data reporting and analytics customization. Let me know if you'd like assistance setting up a tailored reporting solution that fits your business needs.

Hope this helps! Let me know if you have any questions.

Best,
[XERIONIZ]
🚀 Shopify Dropshipping & Store Optimization Expert

CodingFifty
Shopify Partner
874 128 161

Hi @hughespc,

 

You can use apps like Better Reports, Report Pundit, or Mipler from the Shopify App Store to generate reports on the top 50 selling products with inventory levels. These apps provide customizable reports, advanced analytics, and easy data export options to help track sales and stock efficiently.

Coding Fifty || Shopify Partner
For any custom section queries, please visit: Fiverr Profile
Found my response useful? Like it and mark as Accepted Solution!
For additional discussions, reach out via: Email ID: codingfifty@gmail.com
hughespc
Visitor
3 0 0

HI

I do not have a product_variant, cannot see any exposed inventory data,  but it happily shows under products or inventory in the dashboard for the site.

Thanks

CodingFifty
Shopify Partner
874 128 161

If your inventory data is visible in the Shopify dashboard but not through product variants, try using Shopify’s Inventory Reports under Analytics or export the inventory data from Products > Inventory. Apps like Better Reports, Report Pundit, or Mipler can also pull inventory details directly from the "Products" or "Inventory" sections instead of variants.

Coding Fifty || Shopify Partner
For any custom section queries, please visit: Fiverr Profile
Found my response useful? Like it and mark as Accepted Solution!
For additional discussions, reach out via: Email ID: codingfifty@gmail.com
hughespc
Visitor
3 0 0

Sorry I do not have product_variants or inventory when looking in shopifyql ie SHOW <list of tables Available> neither is listed