Using case statements to group results?

Ok, so imagine this. Imagine that I am searching through a database, and one of the columns is "FRUIT". In the "FRUIT" column, there are several possible values that are different types of apples. For instance, "Honeycrisp Apple", "Gala Apple", "Granny Smith Apple", and so on. Sometimes, I might want to combine these results into simply "Apple", and an easy way to do that would be to just write a bunch of case statements.

CASE FRUIT
WHEN "Gala Apple" THEN "Apple"
WHEN "Honeycrisp Apple" THEN "Apple"

Then I can just group on "Apple". Now, I know I can just write this in SQL but then I don't have the built in filterability. Is there a way to replicate this in Metabase using the editor so that I retain the ability to filter?

Hi @chadwicke
Yes, you can use Custom Column with an expression like this:
case(contains([Fruit], "Apple"), "Apple", [Fruit])
For reference: https://www.metabase.com/learn/questions/custom-expressions

Thanks Flamber - that is helpful!

Out of curiosity, why do I need the "contains"? Can I not simply do:

case([FRUIT] = "Gala Apple", "Apple", [FRUIT] = "Pink Lady Apple", "Apple", [FRUIT] = "Granny Smith Apple", "Apple")

?

Nevermind! I totally see what is going on! This is perfect! Thanks Flamber!