Need help with BrewQL search string

In the custom reporst section I want to filter out all the containers with the following criteria:

  • Location: Brewery.Main
  • Code contains KU*
  • is not empty
  • is not with customer

The not empty part of the string is giving me difficulty.

code ~ "KU" and current_location.site.name = "Brewery" and current_racking.container.empty_at_brewery = False

Throws me “There was a problem with the BrewwQL. Please double-check that it is valid. You are filtering on Container data having already traversed away from it. This is likely a mistake and will not return the data you are expecting. You can likely simplify your filter to achieve what you would like.”

This doesn’t make sense - any suggestion what is going wrong?

I also haven’t figured out a good way to filter the “not with customer” bit

EDIT: OP was about the containers section of breww - as I need to export it to csv I need it as a custom report

Hi Gijs,

Thanks for your comment! I’ve had a look at this, and it sounds like the following filter should give you what you need:

current_location.site.name = "Brewery" and current_location.name = "Main" and code ~ "KU" and empty_at_brewery = False and current_customer = None

Let me know if you need any more support with this. Cheers!