Forum Discussion
ValeriaBreve
2 years agoPost Partisan
List.FindText with items from a list?
Hello, I have 2 lists: ListData ListFilter both containing text strings. I would like to find any item in ListData that contains any part of a string from ListFilter. ex. ListData: {"red apple...
- 2 years ago
Another approach, using List.Accumulate to cycle through the ListFilter:
let ListData= {"red apple", "blue apple", "green banana", "red pear"}, ListFilter={"apple","pear"}, filter = List.Accumulate( ListFilter, {}, (s,c)=> s & List.FindText(ListData,c)) in filter
ZhangKun
2 years agoSuper User
My answer did not use the List.FindText function (it is easier to use List.FindText), so I deleted the answer. If you still have problems, you should provide the data row in question, such as "2024 Q1" as you said.
ValeriaBreve
2 years agoPost Partisan
Hi ZhangKun thanks but what a pity! Your solution was working perfectly as well and was a nice alternative 🙂 Thanks!