Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello
How to check if two strings are available and if another string is not available between them?
data = "aaaa bbbb cccc dddd eeee ffff"
I want to generate "True" in the cell if "aaaa" and "eeee" exist and "cccc" does not exist between them? Is it possible to do that?
Thanks
Amine
Solved! Go to Solution.
Hi @cher90 ,
Please create a custom column.
if Text.Contains([data],"aaaa",Comparer.OrdinalIgnoreCase)
and
Text.Contains([data],"eeee",Comparer.OrdinalIgnoreCase) and
not Text.Contains([data],"cccc",Comparer.OrdinalIgnoreCase)=true then "TRUE" else "FALSE"
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thaanks 😄
Actually I want to do this in power query but it doesn't work
Thanks for your help!
Hi @cher90 ,
Please create a custom column.
if Text.Contains([data],"aaaa",Comparer.OrdinalIgnoreCase)
and
Text.Contains([data],"eeee",Comparer.OrdinalIgnoreCase) and
not Text.Contains([data],"cccc",Comparer.OrdinalIgnoreCase)=true then "TRUE" else "FALSE"
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks!
Hello
How to check if two strings are available and if another string is not available between them?
data
a |
aaa bbb eee fff aaa hhh jjjj ccc |
a |
a |
a |
a |
a |
a |
I want to replace the value with "True" in the cell if "aaa" and "eee" exist and "ccc" does not exist between them? Is it possible to do that?
Thanks
Amine
Hi @cher90 ,
You can also create a column like @SergioSilvaPT 's.
column = IF(
CONTAINSSTRING (('Table'[data]), "aaaa") && CONTAINSSTRING (('Table'[data]), "eeee") && NOT CONTAINSSTRING (('Table'[data]), "cccc"),
TRUE(),
FALSE())
If I have misunderstood your meaning, pelase provide more details with your desired output.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @cher90 ,
You can do that with IF and CONTAINSSTRING:
IF(
CONTAINSSTRING (SELECTEDVALUE(Data), "aaaa") && CONTAINSSTRING (SELECTEDVALUE(Data), "bbbb") && NOT CONTAINSSTRING (SELECTEDVALUE(Data), "cccc");
TRUE();
FALSE())
Regards,
Sérgio Silva
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
User | Count |
---|---|
101 | |
90 | |
80 | |
71 | |
70 |
User | Count |
---|---|
114 | |
99 | |
97 | |
73 | |
72 |