How to sort Item Sales Report by Sales quantity

Do you know how to make the Item Sales Report to sort by Sales quantity instead of the default Sales total? The codes inside reports are so hard to understand for me.

[Group Sales by Amount:2, 1, 1]
{REPORT ORDER DETAILS:O.ItemGroup,O.ExactTotal.Percent.desc,O.ExactTotal.Sum:(ODI=True)}
>Total|{REPORT ORDER DETAILS:O.ExactTotal.Sum:(ODI=True)}

[Group Sales by Quantity:2, 1, 1]
{REPORT ORDER DETAILS:O.ItemGroup,O.Quantity.Percent.desc,O.Quantity.Sum:(ODI=True)}
>Total||{REPORT ORDER DETAILS:O.Quantity.Sum:(ODI=True)}

[Sales:5, 2, 2,1]
@{REPORT ORDER DETAILS:O.MenuItemName,O.ExactTotal.Sum.desc:(ODI=True):{0}:,}
>{REPORT ORDER DETAILS:O.MenuItemName,O.Quantity.Sum.desc,O.ExactTotal.Sum.desc:(ODI=True) and O.MenuItemName="$1"}
{REPORT ORDER DETAILS:'     '+[O.PortionName],O.Quantity.Sum.desc,O.ExactTotal.Sum.desc:(ODI=True) and O.MenuItemName="$1":2}


Try taking .desc off of the total column.

1 Like

Thank you for your advice! It works after doing this edit:

[Sales:5, 2, 2,1]
@{REPORT ORDER DETAILS:O.MenuItemName,O.Quantity.Sum.desc:(ODI=True):{0}:,}