I want to create an sql query that will count the number of order per category month on month on a defined time frame.

i.e. from 1st april 2016 to 31st dec 2016, list number of orders per category and display by month

there will be overlap of order numbers since orders could have multiple categories in them... thats fine... and only need level 1 category breakup

is this even possible?

1 Answer 1


Magento, does not save category related data in sales model. So,not possible to get categories wise Order list,

Only possible to get order list basic of current categories list.

  • so it would then mean that we need to get a product wise number of orders list and then club together data of all products within the same category right?
    – Bijal
    Jan 20, 2017 at 7:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.