Department Item Sales grouped by Meal Type

[Orders:5,3,2,1,1]
>>$1
>Food
>>Item|Quantity|Total
{REPORT ORDER DETAILS:O.MenuItemName.desc,O.Quantity.sum,O.ExactTotal.Sum:(MT.Meal 
Type=Food):(ODI=True) AND (DE=$1)}
>>Total:||{REPORT ORDER DETAILS:O.ExactTotal.Sum:(MT.Meal Type=Food):(ODI=True) AND 
(DE=$1)}
@{REPORT ORDER DETAILS:O.Department::,}
[Orders:5,3,2,1,1]
>>$1
>Drinks
>>Item|Quantity|Total
{REPORT ORDER DETAILS:O.MenuItemName.desc,O.Quantity.sum,O.ExactTotal.Sum:(MT.Meal 
Type=Drinks):(ODI=True) AND (DE=$1)}
>>Total:||{REPORT ORDER DETAILS:O.ExactTotal.Sum:(MT.Meal Type=Drinks):(ODI=True) AND 
(DE=$1)}

Hey, need help. I’m trying to categorize the report above by Department but cant seem to get it working. But when I remove all the department tags am able to get the data I want.

Your $1 is declared once in the middle but referred to above it in the @.
Should be able to do in single report
@departments list report expression
@@Food,Drinks
$1 for departments
$2 for type

Something like that or maybe the other way round actually