Exclude results from custom report query

Hi,

we are building a custom report with:

select  `tabSales Order Item`.item_code as "Item:Link/Item:120"

But we need to exclude from the report the Items that contain a certain String “RET”, how can this be done? We were checking this page but an example is missing:
https://frappe.io/kb/reports/how-to-make-query-report

Read up a bit on Mariadb functions you can use SUBSTRING or REGEX

OK, thanks. Regex is very useful.

We see that you implement already ranges using “:” and comparative filters with “>” and “>”. Could you consider implementing generally in reports a filter that start with “!” to exclude a certain string? I think this may be useful in many situations.

I think there is already such a filter try:

{key: ["!=",value]}

Thanks, just to clarify i meant not editing the report but adding the option in the filters that come with the results under the header.

We tried your code in the filter under “Item” in an standard report but does not work:

{Item: ["!=",HP02]}

Value must be in quotes

{item_code: ["!=","HP02"]}

Make sure your fieldnames are correct.