@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
FRUITSVILLE
EXQUIS PLATTER
QUBES
DORO SHARWAMA
GIZDOLAD
Now when I generate the report everything works fine except the first product group (FRUITSVILLE). it does not show the write quantity.
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.
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.
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.
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.