Nested Loops in Reports

Im trying to figure out how to run a nested loop on a report.

[Items Sold:2,5, 2, 2,1]
@{REPORT ORDER DETAILS:O.ItemGroup, O.MenuItemName,O.ExactTotal.Sum.desc:(ODI=True):{0}:,}
{REPORT ORDER DETAILS:O.ItemGroup, O.MenuItemName,O.Quantity.Sum.desc,O.ExactTotal.Sum.desc:(ODI=True) and O.MenuItemName == “$1”}

This prints the report fine.

But how can i group them by O.ItemGroup.
Basically need each ItemGroup to make a separate sub-table, and show the items under that ItemGroup.

Sounds like you might need to use visual reports and setup a pivot table view.

1 Like

Get a list of groups in @
Then you can use that in the table header like such;
This was done on the fly so may not work but give the idea.

[$1 Items Sold:5, 2, 2,1]
{REPORT ORDER DETAILS:O.MenuItemName,O.Quantity.Sum.desc,O.ExactTotal.Sum:(ODI=True) and O.ItemGroup=$1}

managed to get it to work. Based around the same code as JTRTech.
Pivot tables were huge so i skipped them.