Filtering Items in Reports

I wanted to print a special report for products sold belonging to a particular group.

[Promotions Sold:2,1, 1]
@{REPORT ORDER DETAILS:O.MenuItemName,O.ItemGroup,O.Quantity.Sum.desc:(ODI=True):{0}:,}
{REPORT ORDER DETAILS:O.MenuItemName,O.ItemGroup,O.Quantity.sum;#:(ODI=True) and O.MenuItemName="$1"}

This works,

But when i do:

[Promotions Sold:2,1, 1]
@{REPORT ORDER DETAILS:O.MenuItemName,O.ItemGroup,O.Quantity.Sum.desc:(ODI=True):{0}:,}
{REPORT ORDER DETAILS:O.MenuItemName,O.ItemGroup,O.Quantity.sum;#:(ODI=True) and O.MenuItemName="$1" and O.ItemGroup=“Promotion”}

it fai!s!

Im confused because it does print the ItemGroup correct in the report when i dont have the condition for particular group. Adding the comparison in the end kills everything.

Tried this as well:

@{REPORT ORDER DETAILS:O.MenuItemName,O.ItemGroup,O.Quantity.Sum.desc:(ODI=True) and O.ItemGroup=“Promotion”:{0}:,}
{REPORT ORDER DETAILS:O.MenuItemName,O.ItemGroup,O.Quantity.sum;#:(ODI=True) and O.MenuItemName="$1"}

Doesn’t seem to work!

example provided by @emre at Report for Order Tags?
over here also i see additional conditions that do work!

Try without the double quotes O.ItemGroup=Promotion

G.

Doesnt seem to work… Single quotes, double quotes, no quotes…
so confused at this point. All my reports are ready… just need this solved…

TRY

{REPORT ORDER
DETAILS:O.MenuItemName,O.ItemGroup,O.Quantity.sum;#:(ODI=True) and
(MG=Promotion)}

G.

MG worked!!! Thanks a lot!
I guess that MG means Menu Group…

But then im stuck again in a similar situation with another part! lol.

Another table i need to filter by OSV.GStatus=Promotion.

[Items Sold under Promotion:2,1,1,1]
@{REPORT ORDER DETAILS:O.MenuItemName,O.ItemGroup,O.Quantity.Sum.desc:(ODI=True):{0}:,}
{REPORT ORDER DETAILS:O.MenuItemName,OSV.GStatus,O.Quantity.sum;#:(ODI=True) and O.MenuItemName="$1"}

Thats the current query, OSV.Gstatus = Promotion needs to be filtered.

Another part, i needed to filter (MG!=Promotion), that fails too. :frowning:

I wonder if there is a reference somewhere to be able to figure these out.

I never used this… it should work…

try narrowing down the problems… first try the != part, when it works, go on adding filters

Alright… Thanks!

will try a few other things, see how things go…
tried != <> … that didnt work.

Strange thing is this table is exactly the same as the other one, just flipping the equating value.
One = Promotion
Two != Promotion

!= does not always work, not seen it used in a (bracketed expression) only the field type expression which is unbracketed.
Might have to try the column constraint used couple of times recently but not sure if thats only valid in REPORT SQL tags.

This will probably help you. I highly recommend reading this.

https://www.sambapos.com/wiki/doku.php/custom_reporting

I have been reading through all these docs for a couple of weeks now…
Have solved almost everything. Just have to figure out these conditional tags.
Basically i need the following 3 working.
Promotions Sold (Table #2) works. The other two don’t

Following is my current code,
Already tried with and without single,double quotes, brackets, !=, <> don’t know what else i can try.

is there some kind of a print_r() on the report object ? so i can see the structure and figure out a way to solve this.

[Items Sold: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" and (MG!=Promotion) and (OSV.GStatus!=Promotion)}

[Promotions Sold: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" and (MG=Promotion)}

[Items Sold under Promotion: 5, 2, 2,1]
@{REPORT ORDER DETAILS:O.MenuItemName,O.ExactTotal.Sum.desc:(ODI=True):{0}:,}
{REPORT ORDER DETAILS:O.MenuItemName,OSV.GStatus,O.Quantity.Sum.desc,O.ExactTotal.Sum.desc:(ODI=True) and O.MenuItemName="$1" and OSV.GStatus=Promotion}