I’m trying to generate a report that provides data on online sales by shipping country. I successfully created this report, but the total net sales in my online sales report differs from the net sales reported in the pre-built “Net Sales by Channel” report.
Below are the relevant codes. To my understanding, these reports should show the exact same total net sales when the reporting period is identical. Where’s the problem?
FROM sales
SHOW net_sales, returns, taxes, taxes_returned
WHERE sales_channel IS NOT NULL AND shipping_country IS NOT NULL
GROUP BY sales_channel, shipping_country
WITH GROUP_TOTALS, TOTALS, PERCENT_CHANGE
SINCE last_month
UNTIL last_month
COMPARE TO previous_year
ORDER BY net_sales__sales_channel_totals DESC, net_sales DESC, sales_channel ASC, shipping_country ASC
LIMIT 1000
VISUALIZE returns TYPE horizontal_bar
FROM sales
SHOW net_sales
WHERE sales_channel IS NOT NULL
GROUP BY sales_channel
WITH TOTALS
SINCE last_month
UNTIL last_month
ORDER BY net_sales DESC
LIMIT 1000
VISUALIZE net_sales TYPE horizontal_bar