skip to Main Content

I am trying to create a DataFlow under Azure Data Factory and I need to check if my array contains values from another column. These are the information:
enter image description here

I have a table with 3 columns and I need to check if the value from the column ‘job’ is inside of the array of values of the column ‘array’.
I create a derive column and use the expression:

contains([array], [job]

)

But it gives me the error: enter image description here

2

Answers


  1. Your array column may string type. Hence we need to write our expression to generate array type data first and then search job in it. Kindly consider using below expression.

    contains(split(replace(replace(replace(arrayCol, '[', ''),']',''),'"'),','), #item == job)
    

    Please check below screenshot where I tried same.
    enter image description here

    Login or Signup to reply.
  2. Use the find() function to check for the existence of a value in your arrays. https://learn.microsoft.com/en-us/azure/data-factory/data-flow-expressions-usage#find

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search