ShopifyQL GraphQL Issue: WITH TOTALS Returns Full Range Totals Repeated on Every Daily Row

Hi Shopify Dev Community,

I’m facing an issue with shopifyqlQuery in GraphQL and would like to check whether this is expected behavior or if anyone has experienced the same.

Query with date range

When I run this query across multiple days:

{



  "query": "query { shopifyqlQuery(query: \"FROM sessions, web_performance, search_queries SHOW sessions, sessions_with_cart_additions, sessions_that_reached_checkout, cls_good_view_count, cls_okay_view_count, search_queries_with_clicks GROUP BY day WITH TOTALS TIMESERIES day SINCE 2026-05-02 UNTIL 2026-05-12 ORDER BY day ASC\") { tableData { columns { name dataType displayName } rows } parseErrors } }"
}

I receive results like this:

{
  "day": "2026-05-03",
  "sessions": "1280",
  "sessions_with_cart_additions": "39",
  "sessions_that_reached_checkout": "19",
  "cls_good_view_count": "52",
  "cls_okay_view_count": "2",
  "search_queries_with_clicks": "0",
  "sessions__totals": "14357",
  "sessions_with_cart_additions__totals": "357",
  "sessions_that_reached_checkout__totals": "174",
  "cls_good_view_count__totals": "526",
  "cls_okay_view_count__totals": "9",
  "search_queries_with_clicks__totals": "6"
}

As you can see, the __totals fields are repeated on every row and represent the total for the full date range, not the specific day.


Query for a single day

But when I run the exact same query for only one day:

{
  "query": "query { shopifyqlQuery(query: \"FROM sessions, web_performance, search_queries SHOW sessions, sessions_with_cart_additions, sessions_that_reached_checkout, cls_good_view_count, cls_okay_view_count, search_queries_with_clicks GROUP BY day WITH TOTALS TIMESERIES day SINCE 2026-05-03 UNTIL 2026-05-03 ORDER BY day ASC\") { tableData { columns { name dataType displayName } rows } parseErrors } }"
}

I get:

{
  "day": "2026-05-03",
  "sessions": "1280",
  "sessions_with_cart_additions": "39",
  "sessions_that_reached_checkout": "19",
  "cls_good_view_count": "52",
  "cls_okay_view_count": "2",
  "search_queries_with_clicks": "0",
  "sessions__totals": "1280",
  "sessions_with_cart_additions__totals": "39",
  "sessions_that_reached_checkout__totals": "19",
  "cls_good_view_count__totals": "52",
  "cls_okay_view_count__totals": "2",
  "search_queries_with_clicks__totals": "0"
}

This looks correct because totals match that single day.


My question

Is this the expected behavior of WITH TOTALS in ShopifyQL?

Should the __totals fields always represent the total of the full queried range and be repeated on every row?

Or is there a better way to retrieve per-day totals without this duplication behavior?

Would appreciate any clarification from the team or community.

Thank you!

Hey @Tung_Vu :waving_hand: You’re reading the response correctly. WITH TOTALS is returning full range totals, rather than daily totals.

In ShopifyQL, WITH TOTALS adds top level metric summaries before the dimensional breakdown. With GROUP BY day or TIMESERIES day, the regular metric fields like sessions, sessions_with_cart_additions, and sessions_that_reached_checkout are the daily values. The generated __totals fields are totals for the full SINCE and UNTIL range. They repeat on each row because shopifyqlQuery returns a flat table response rather than a separate summary object.

The one day query looks different because the full queried range is one day, so the query level total matches that day’s grouped value.

If you only need daily values, remove WITH TOTALS.

FROM sessions, web_performance, search_queries
  SHOW sessions, sessions_with_cart_additions, sessions_that_reached_checkout, cls_good_view_count, cls_okay_view_count, search_queries_with_clicks
  GROUP BY day
  TIMESERIES day
  SINCE 2026-05-02 UNTIL 2026-05-12
  ORDER BY day ASC

If you need both daily rows and a full range total, keep WITH TOTALS and read each __totals value once from any row. If you meant running totals across the date range, WITH CUMULATIVE_VALUES may be closer to what you need. Hope this helps!

Thanks for your support, Donal!