I am using Azure Data Factory Mapping Data Flows.
I am trying to write an equivalent of sql 'case' statement to get a value in a derived column based on cashed sink.
My cashed sink input is a query: 'select ID from dbo.aaa'. It returns all ID as Integers, they are visible in 'Data Preview'.
My derived column expression is:
iif(contains(chachedIDs#, #item==ID), "upserted row", "deleted row").
The above must be wrong as I cannot preview, ADF says: 'Type mismatch'. 'Expression type could not be evaluated, correct the expression'
To use sink cache in dataflow expression, you need to use Cached lookup functions
.
Use the below expression in the derived column to achieve your requirement.
iif(contains(sink1#outputs(),#item.ID== ID),'upserted row','deleted row')
My cached lookup output:
Use the above expression and this is my result.
While transforming these data to any other sink file, make sure you give correct sink ordering in settings.