Custom Question Editor - Distinct rows instead of duplicated rows when user explore

Ehy Guys,

I created a custom question using the custom editor, having multiple JOIN.

I have been able to select the columns relevant to me for each JOIN.

Now I want to allow users to drill into the data.

My problem is that the generated table has duplicated rows, I would love to have DISTINCT rows.

Is there a way for me to explicitly say that when a user explore the data only DISTINCT rows are displayed?

Many thanks.

Hi @erre
You would have to make the joins, so they don't produce duplicate rows. Or summarize the results. Or use SQL.
It sounds like you're using the wrong columns to join with - or the wrong join type.

Here the JOIN I am making, they are correct, but by default they produce duplicated rows, which I could simply remove adding a DISTINCT.

Is there a way to change JOIN type or to add a DISTINCT keyword?


@erre You would have to do that in SQL.

Got it, many thanks!

It might be an interesting feature to add, a simple flag "remove duplicates if any"


@erre You can remove duplicates by grouping by columns you want to return. I doubt that Metabase will get such a feature, since it is not normal to have duplicate rows if you're doing normal joins on logical columns, and it would be too easy for people to get unexpected results.