Custom Report tag not equal

I am trying to filter an item sales report to exclude Items with Group Code ‘Other’
{REPORT ORDER DETAILS:O.ItemGroup,O.ExactTotal.Percent,O.ExactTotal.Sum: (MG!=Other)}
I have tried (MG!=Other) and (MG<>Other) but they wont work.
There are over 30 other categories so I don’t want to have to include them all in the report and would rather exclude this Group

Im pretty sure != is not supported, I have seen it work on a few expressions but generally these expressions would be = only.

But try O.ItemGroup!=Other without brackets just encase;

{REPORT ORDER DETAILS:O.ItemGroup,O.ExactTotal.Percent,O.ExactTotal.Sum:O.ItemGroup!=Other}

Thats the first method I tried and it didn’t work. It looks like it may not be possible.

Have you tried scripting? Something like: MG.indexOf('Other') < 0 Just guessing but I found I could use .contains('astring') to get around stuff like !=.

Try M.GroupCode != "Other"


This isn’t working for me. Trying to constraint by O.Portion Name

{REPORT ORDER DETAILS:T.Time,O.ItemGroup,O.PortionName:(TEN.Employee={SETTING:CURRENTUSER}) AND (O.PortionName != “Normal”)}




Take the brackets off, M.GroupCode isn’t a normal report expression as its a field :slight_smile:

Look at his example, your using it wrong.

{REPORT ORDER DETAILS:T.Time,O.ItemGroup,O.PortionName:(TEN.Employee={SETTING:CURRENTUSER}) AND (O.PortionName!=Normal)}

Doesn’t work, nothing shows.


The brackets are still there??!??

{REPORT ORDER DETAILS:T.Time,O.ItemGroup,O.PortionName:(TEN.Employee={SETTING:CURRENTUSER}) AND O.PortionName!=Normal}

I’m confused:

() = Parenthesis
{} = Brackets

Why would parenthesis have produce errors, does it just serve to group terms?


O.PortionName is not a report Parenthesis.
Its a field.
Same as if you use SQL script or the SQL report you would use $1= without brackets.

If you dont believe me look at the default item sales report, it uses that exact expression O.PortionName!=Normal without brackets :slight_smile:

Thanks I’ll try this in a minute.


It should be


Im also stuck in the same position.

This works:
@{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)}

But this fails:
@{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)}

Easiest solution to solve this…

Make an order added rule which sets a new order state if group=promotion
If you make the State Name = Promotion and the State = True or False depending on group by adding two actions with constraints for == and !=
THen change the report to be OS.Promotion=True and OS.Promotion=False

This would not be backdateable unfortunatly but should do the job going forward.

Try MenuItem.GroupCode != "Promotion"


Change menu item name expression as O.MenuItemName == "$1"

1 Like

Thank Emre! that did work!

one final thing to bother you guys over now… got to do with grouping and adding rows.

Using the codes discussed above i have this little table:

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

It works almost fine.
But it is printing each order in a new line instead of a sum result.

Pizza 1
Salad 1
Coke 1
Pizza 1
Salad 1

but it should print:
Pizza 2
Salad 2
Coke 1

What’s the ;# ?
The .sum sould cumulate the products on qty…
Also don’t think you need the @ line.
Your saying list orders where ODI= True the using that list reporting orders where ODI= True names =$1 and gift…

You should just report using the second line, your doubling your query and adding extra constraints on second round…

Co./Last Name,First Name,Card ID,Addr 1, - Line 1,- Line 2, - Line 3,- City,- Country,Phone,Email,Terms - Payment is Due,- Discount Days,- Balance Due Days,

Bold Part Not Working.
“5”,“31”,“31” I want to display these values to all fields And exclude only one category member.
I Tried using OR but not getting there

I Tried Another Method. Not Able to get target result.
[Customer NOT Purchased LD embedded:4,1,1,1, 2]
SELECT ent.[Name] as [EntityName], ent.[CustomData] as [Cd]
FROM [Entities] ent – give your tables a short alias like ent or tkt
WHERE ent.[EntityTypeId] =1
ORDER BY Cd(Name=MemberType)Value