Filter, then select distinct. What's the trick??

Jesse Cotari shared this problem 4 years ago

I have a data table with two columns, let's say first and last name, and I want to do a search that only returns the unique first names in a data grid, called Names.

For example

First Last

Joe Harris

Joe Potrero

Jack Alpert

Terence Miller

I want the search -> results to work like this:

Search "J" -> get Joe, Jack (Not Joe, Joe, Jack)

Search "Jo" -> get Joe

It seems like this should use a "set value" function on the data grid like this:

SelectDistinct(Filter(Names, (First has SearchTerm)), First)

but no combination of SelectDistinct, Select, FilterDistinct, or Filter functions are working for me.

This seems like such a simple use of the functions that already exist. Why isn't this working??

Comments (1)


Ah, never mind. Figured it out as I was giving up and going to bed.


Filter(FilterDistinct(Names, First), (First Has SearchTerm))

I knew this forum would help me figure it out.