Forum Discussion
MStaford
1 year agoRegular Visitor
Case insensitive table.findtext across multiple columns
Hi All, I have a situation where I have to bring across only those rows where a specific values specific value (lets say, "true") appears in 5 selected columns with multiple files with each includi...
- 1 year ago
Hi MStaford
Still using the same code in my initital post but changing List.AllTrue to List.AnyTrue to check if at least one of the column values contains the word true..
let // Step 1: Define a list of values, replace with the actual column names ColumnsAsAList = {[bla1], [yaba2], [daba3], [lama], [doo]}, // Step 2: Convert each value in the list to a logical (true/false) ChangedType = List.Transform(ColumnsAsAList, Logical.From), // Step 3: Check if all values in the list are true. Use List.AnyTrue to return true if any of the values in the list is true TrueOnly = List.AnyTrue(ChangedType) in TrueOnly
Anonymous
1 year agoNot applicable
Hi ,
The method ryan_mayu provided should be helpful.
Besides, you can also try the following formula to add the custom column.
if Text.Contains([bla1], "true", Comparer.OrdinalIgnoreCase) or
Text.Contains([yaba2], "true", Comparer.OrdinalIgnoreCase) or
Text.Contains([daba3], "true", Comparer.OrdinalIgnoreCase) or
Text.Contains([lama], "true", Comparer.OrdinalIgnoreCase) or
Text.Contains([doo], "true", Comparer.OrdinalIgnoreCase)
then "true" else "false"
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.