Forum

Compare Lists Withi...
 
Notifications
Clear all

Compare Lists Within Custom Columns - Return Matching Values

4 Posts
2 Users
0 Reactions
91 Views
(@digaloguapo)
Posts: 23
Eminent Member
Topic starter
 

I'm trying to do something simple that I think should work in theory, but I keep getting an error. I'm trying to compare 2 lists within a custom column and return the values that match {List1, List2}

 

List1 = Text.Split([Keyword], " ")  => [Keyword] = Mens Black Dress Shoes

List2 = Text.Split([Tag], " ") +> [Tag] = Dress Shoes

 

To return the match between the 2 lists, I'm using this formula inside a custom column:

List.Intersect([List1],[List2])

 

I'm thinking it should work, but I keep getting an error:

Expression.Error: We cannot convert the value "shoes" to type Function.
Details:
Value=shoes
Type=[Type]

 

Can anyone tell me what I'm doing wrong or if what I'm trying to do is not possible?

 

Thanks!

 
Posted : 02/08/2020 1:40 pm
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

Hi,

List.Intersect requires the lists be supplied as a list.  As written above it thinks that List2 is the 2nd optional parameter equationCriteria

 

let
   List1 = Text.Split("Mens Black Dress Shoes", " "),
   List2 = Text.Split("Dress Shoes", " "),
   Result = List.Intersect({List1,List2})
in
   Result

 

Regards

Phil

 
Posted : 03/08/2020 1:08 am
(@digaloguapo)
Posts: 23
Eminent Member
Topic starter
 

Thanks so much, Philip. Such a simple solution!

 

I apologize for the late follow-up. I had surgery a week and a half ago and have been slowly recovering.

 

Thanks again!

 
Posted : 13/08/2020 12:34 pm
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

No worries, hope the recovery goes well.

 
Posted : 13/08/2020 6:40 pm
Share: