Group Item Sales Report

@FRUITSVILLE,EXQUIS PLATTER,QUBES,DORO SHARWAMA,GIZDOLAD,
@{REPORT ORDER DETAILS:O.MenuItemName,O.ExactTotal.Sum.desc:(ODI=True):{0}:|}


[$1 Sales:8, 2, 2]
>{REPORT ORDER DETAILS:O.MenuItemName,O.Quantity.Sum.desc,O.ExactTotal.Sum.desc:(ODI=True) and O.MenuItemName="$2" and (MG=$1)}
{REPORT ORDER DETAILS:'        '+[O.PortionName],O.Quantity.Sum.desc,O.ExactTotal.Sum.desc:(ODI=True) and O.MenuItemName="$2" and (MG=$1) and O.PortionName!="Normal"}
>>Total $1|{REPORT ORDER DETAILS:O.Quantity.Sum,O.ExactTotal.Sum:(ODI=True) and (MG=$1)}
{REPORT ORDER DETAILS:O.Quantity.Sum,O.ExactTotal.Sum:(ODI=True) and (MG=FRUITSVILLE) OR (MG=EXQUIS PLATTER) OR (MG=QUBES) OR (MG=DORO SHARWAMA) OR (MG=GIZDOLAD)}

[Item Sales:8, 2, 2, 2]
{REPORT ORDER DETAILS:O.ItemGroup,O.ExactTotal.Percent,O.Quantity.Sum,O.ExactTotal.Sum}
>>Total Sales||{REPORT ORDER DETAILS:O.ExactTotal.Sum}
{REPORT ORDER DETAILS:O.Quantity.Sum,O.ExactTotal.Sum:(ODI=True) and (MG=FRUITSVILLE) OR (MG=EXQUIS PLATTER) OR (MG=QUBES) OR (MG=DORO SHARWAMA) OR (MG=GIZDOLAD)}

The code gives an item sales report Group-wise. EG.

I have 5 Product group

  1. FRUITSVILLE
  2. EXQUIS PLATTER
  3. QUBES
  4. DORO SHARWAMA
  5. GIZDOLAD

Now when I generate the report everything works fine except the first product group (FRUITSVILLE). it does not show the write quantity.

Please help me fix.

What is exactly expected value of FRUITSVILLE quantity?

Thank you for your reply. I asked the wrong question.


The Values is correct. But the total is wrong.

Other Product group is correct.

Are you sure it’s not the other way round and total correct and breakdown if wrong?
Maybe something funky in portions line?
Cross reference with a simpler report like default report.

Also, what’s the line with the ORs in it?

Put the and at the end.

Other Group report is perfect. Only this is given me an error. Break down is correct, total is wrong.


The default Item sales report does not show items sold from this product group. just notice now. And I didn’t modify the default report.

I created a new DB Thinking I may have messed up this current DB. I sold 1 (one) item for each product group, 5 (Five) quantities. And did the default Item sales report. See what happen.

I copied and paste the code. I dont really know. I just change the product group name to mine. If see a better code that will give me what I want I will be happy.

I dont know where thw ‘and’ is or where to put it

1 Like

When using AND and OR you need to understand the logic of what it is doing. When you put it in the front it your telling it to do X and Y then Or z Or C but it may ignore Y if it does C.

By putting the and at end it will do A, or B, or C, or D and X So it will look at a, b, c, or d and always include X.

You can also write it as A and X or B and x or C and X

Likely your expecting it to do something beause your not understanding what it is doing when in fact its returning what it is suposed to return but your expecting something else.

1 Like

You are using a lot of parameter based filtering. This can also create very slow performing reports because it has to search the entire database for EVERY parameter. You saved some time by hard coding the names in first parameter but second one its doing extra database activity for each parameter.

Interesting, never realised that, always presumed normal mathematical type logic.

This Report Import file is here : Product Group Report.txt.zip (2.0 KB)

Please Only use Import, Don’t use copy paste for this report.

Sample SS:

2 Likes