Jun 24 2021
09:29 AM
- last edited on
Apr 08 2022
10:50 AM
by
TechCommunityAP
Jun 24 2021
09:29 AM
- last edited on
Apr 08 2022
10:50 AM
by
TechCommunityAP
I am trying to pass an array to the where clause, please see example below:
let terms = pack_array('12345', 'ABC123');
ADFPipelineRun
| where ResourceId has_any (terms)
I am aware I can use where statements with 'and' 'or' operators with multiple values, but we could be looking at 100s different values.
Can someone please advise on the best approach?
Jun 28 2021 12:17 PM
@nicholas888 - assuming you're looking to match full strings, you'll want to use the "in" operator to achieve this. To reuse your example, your query becomes:
let terms = pack_array('12345', 'ABC123');
ADFPipelineRun
| where ResourceId in (terms)
"has_any", as you have it, would be more the equivalent of Col contains 'term1' OR Col contains 'term2' OR [...]. "In" replaces the contains with ==s.
Jun 28 2021 12:34 PM
@Evgeny Ternovsky - we tried to match the resource name and not the whole string.
example:
we need a match 39515 only. So IN will not work.
Please advise.