How to do a 'count' of entries grouped by Company Name (not SQL)

Hello!

So I basically have two tables - Companies and Suppliers.

Each company has multiple suppliers.

What I need to see is a count of unique suppliers per company (aka how many suppliers does each company have) but I'm struggling to work out how to do this using Metabase's query builder and not SQL.

Is there a way?

Hey there!

At first glance it would seem like you could join Companies and Suppliers, summarize by "Number of distinct values of..." with Supplier ID, and group by Company ID.

If this doesn't work, could you please share more context on:

  • The schema you're working with
  • The SQL query if you could figure it out using SQL

Thanks so much that did work! Apologies as it's so obvious now!

1 Like