hi, I need to read from sales virtual dataset. anyone with any clue on how to write the query for the sales virtual dataset?
**Logic Behind the “sales” Object**
**The “sales” object is not a raw database table. It is a **pre-joined, virtual dataset** that combines relevant fields from internal Shopify tables such as:**
*** orders**
*** order_line_items**
*** products**
*** refunds**
*** discounts**
**ShopifyQL handles all joins and transformations behind the scenes. Users cannot directly access SQL-level operations like JOIN or CASE statements, but the structure ensures accurate, business-friendly reporting.**
1 Like
Hey @Lujun_Zhang
To point you in the best direction, I need a bit more context about what you’re working on.
Are you using ShopifyQL within the Shopify Admin analytics interface, or are you trying to query this through GraphQL using something like the shopifyqlQuery
field (similar to how segments work with the segmentCreate
mutation)? Also, what’s your end goal: Are you building a custom dashboard, trying to replicate specific analytics data, or working on something else?
The reason I ask is because these details will help me better replicate and correctly answer.
Hey @Lujun_Zhang, Are you still experiencing this issue, or can I mark this as solved?
hi, Kyle, sorry. it was weekend and I didn’t notice it.
I am building a GraphQL query to read from virtual dataset.
Thanks for that clarification. ShopifyQL has been sunset from the admin API so retrieving this data through graphql won’t be possible.