Magento SQL Average Order Value

I need to get the AOV from our store.

Simple SQL code is as follows:

SELECT SUM( grand_total ) / COUNT( * )
FROM `mg_sales_flat_order`
WHERE mg_sales_flat_order.status NOT LIKE ‘canceled’
AND mg_sales_flat_order.status NOT LIKE ‘closed’
AND mg_sales_flat_order.status NOT LIKE ‘fraud’
AND mg_sales_flat_order.status NOT LIKE ‘holded’
AND mg_sales_flat_order.status NOT LIKE ‘paypal_canceled_reversal’

Instead of using grand_total there are a couple of other things you can do which are as follows:

grand_total = product rev + ship – discount inc tax

base_subtotal & subtotal = product revenue exc tax

base_subtotal_incl_tax & subtotal_incl_tax  = product revenue inc tax

Magento | | No Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

« »