Custom Properties

Can I calculate total packaging weight sold using Shopify metafields and units sold?

✓  Report Pundit Answer
Last Update :
QUICK ANSWER

Shopify can show packaging-weight metafields alongside units sold in a report, but can't multiply them into a total since metafields are dimensions, not metrics, and ShopifyQL arithmetic only works on metrics. Getting a real weight total means exporting and multiplying outside Shopify, or defining the metafield correctly first (product vs. variant level, depending on whether packaging varies by variant). Report Pundit pairs the same metafields with Net Units Sold in a variant-level report, but that also still needs the multiplication done separately, and Net Units Sold excludes returns, so it may not fit if the figure needs gross units shipped instead.

Official answer

Shopify lets you add metafields such as packaging weight as dimensions next to a units-sold metric in a report, but it cannot multiply them into a total. ShopifyQL's own documentation states dimensions, which is what metafields are, cannot be used in arithmetic; only metrics can.

Setting it up on Shopify. Each packaging metafield needs to be a Decimal-type metafield with Use in analytics turned on, under Settings → Metafields and metaobjects. Whether it belongs on the Product or the Variant depends on the data: if packaging weight is the same across every variant of a product, a product-level metafield works, but if different variants, different pack sizes for instance, use different amounts of material, the metafield needs to sit on the Variant, or every variant inherits the same product-level number and the totals come out wrong. In Analytics → Reports, open a customizable Sales or Product report (Finance, Fraud, and most Orders reports can't be customized) and add the metafields as Dimensions. Grouping by product variant gives one row per variant, with the metafield value and a quantity metric such as net_items_sold sitting side by side once added, since neither appears in a report's default columns.

Why the math still has to happen outside Shopify. ShopifyQL supports arithmetic (+, -, *, /), but only between metrics. Metafields are always dimensions or filters, never metrics, so there is no expression that multiplies a metafield by net_items_sold inside a Shopify report. Getting to an actual "total kg of plastic packaging this month" figure means exporting the two columns and multiplying them outside Shopify.

Where Report Pundit fits. A reporting app that lets metafields sit next to sales data closes part of the gap Shopify leaves. Report Pundit's Product Variant level report pairs the packaging metafields with Net Units Sold, which nets out returns within the selected date range, and can add Vendor, Product Type, and Cost as extra columns when needed. Turning those columns into an actual monthly total still means multiplying them, whether in the export or through a calculated field built separately. Because the units figure is Net Units Sold, a returned item is excluded from that total; if the packaging figure needs to reflect gross units shipped instead, that would need a different field than the one this solution describes.

Was this answer helpful?

Follow-up questions

COMMUNITY QUESTIONS

Questions & Solutions

Explore Shopify reporting questions and expert solutions from Report Pundit. Ask a follow-up question, and we'll notify you by email once your answer is published.

No questions found.

Ask a Follow-up Question

Need more clarity? Submit your follow-up question below, and our team will review it and provide a solution.

Thanks — your comment has been submitted for review. It will appear on this answer page only after Report Pundit approves it.

Oops! Something went wrong while submitting the form.