Hi,
I am facing this issue where for a particular product I see two entries in inventory adjustment - One during bulk upload and one syncing from my inventory mgmt system but in the inventory adjustment report, I see only one entry.
There is inventory adjustment for it and its not blank. am using below query in reports
FROM inventory_adjustment_history
SHOW inventory_app_name, inventory_adjustment_change
WHERE product_variant_sku = ‘11359’
GROUP BY inventory_app_name
Any idea on how can I fix this?
the GROUP BY is collapsing your rows.
You have two adjustment records, but since you’re grouping only by inventory_app_name, the report is aggregating them into one row per app.
Fix:
Remove the GROUP BY, or include more fields (like timestamp / adjustment ID), or use an aggregate (e.g. SUM(inventory_adjustment_change)) depending on what you want to see.
Example quick check:
FROM inventory_adjustment_history
SHOW inventory_app_name, inventory_adjustment_change, created_at
WHERE product_variant_sku = '11359'
@gagarwal
Apparently cannot do without groupby on , so its
FROM inventory_adjustment_history
SHOW inventory_app_name, inventory_adjustment_change, day
WHERE product_variant_sku = ‘11359’
GROUP BY inventory_app_name, day
doesnt allow me to run this, says inventory_adjustment_change is invalid column
FROM inventory_adjustment_history
SHOW inventory_app_name, SUM(inventory_adjustment_change)
WHERE product_variant_sku = ‘11359’
GROUP BY inventory_app_name
the inventory_app_name is different for both entries