List Building - BrewwQL

Hey Folks,

I’m really struggling to get my head around BrewwQL - for example we will want to be building customer/prospect lists like the following example:

All prospects in Bristol who are NOT Greene King or SIBA

Any ideas?

Cheers
Libby

1 Like

Hi Libby,

Sure, no problem! Assuming that “Prospect”, “Greene King” and “SIBA” are all customer tags then this should do it:

delivery_address_city = "Bristol" and tags = "Prospect" and tags != "Greene King" and tags != "SIBA"

If any of those attributes are actually customer types rather than tags you would just need to replace tags with type.

I should mention that we do have a graphical interface for BrewwQL coming soon which should make filtering much easier for simple queries! It will be based on the one we have on our data-explorer function for selecting column headings and will make filters like this just a couple of clicks. We’re hoping to get it out soon - and we’ll update you here once it’s live!

Cheers,
Max

Hi Libby,

I hope you’re well, sorry for the delay on this, I know it’s something you’ve been after for a long time.

I’m delighted to say we’ve just added a visual filter builder for BrewwQL. This should make creating filters much easier, and we plan to refine it further over time. It will guide you through a couple of questions to create the filters that you’d like.

The way that it works now is that you can add filters and they’ll always be added to the end of the BrewwQL filter with an and (so all the filters added must match). You can then, if you need to, manually swap some of the ands to ors and use any brackets required.

To better explain that with an example - if you wanted customers in Bristol that have either an average over value (AOV) over £100, or have placed at least ten orders, you’d need to manually modify the BrewwQL filter built by the new UI to add this extra logic.

You could build the following with the new visual filter tool (without manually typing any BrewwQL):

address_city = "Bristol" and average_order_value > "100" and number_of_invoiced_orders >= "10"

This requires the city of Bristol and AOV over £100 and to have placed at least 10 orders. To modify this to require the city of Bristol, but then include where the AOV matches or the number of orders matches, you could then edit the BrewwQL to swap the last and to an or (and add brackets to ensure the or applies to the correct part). This BrewwQL would become:

address_city = "Bristol" and (average_order_value > "100" or number_of_invoiced_orders > "10")

Most of the time, you probably don’t need such complicated BrewwQL filters and can simply use the new tool to build what you need, but for those cases where you want to dig deep into the data, you can use the new tool as a starting point and then manually modify it to get to what you need.

We hope this to useful for you, and thanks for your patience with us completing this! We’d welcome any feedback or suggestions of how we can make it better. :+1:

Luke