Forum Discussion
icturion
Resolver II
4 years agoSee if column string contains multiple text values
Hi, Is there a way to search for two or more words within the same string of text? I already tried with containsstring but then I can only give one word. Example data: Column this ...
- 4 years ago
Hi icturion ,
Create a column with below code:-
Column 2 = SWITCH ( TRUE (), CONTAINSSTRING ( 'Table (4)'[Column], "text" ) && CONTAINSSTRING ( 'Table (4)'[Column], "search" ), "Group 1", CONTAINSSTRING ( 'Table (4)'[Column], "sentence" ) && CONTAINSSTRING ( 'Table (4)'[Column], "different" ), "Group 2", "Group 3" )Output:-
Thanks,
Samarth
Samarth_18
Community Champion
4 years agoHi icturion ,
Create a column with below code:-
Column 2 =
SWITCH (
TRUE (),
CONTAINSSTRING ( 'Table (4)'[Column], "text" )
&& CONTAINSSTRING ( 'Table (4)'[Column], "search" ), "Group 1",
CONTAINSSTRING ( 'Table (4)'[Column], "sentence" )
&& CONTAINSSTRING ( 'Table (4)'[Column], "different" ), "Group 2",
"Group 3"
)Output:-
Thanks,
Samarth
icturion
Resolver II
4 years agoThank you, I hadn't thought of the switch function. thanks for thinking along