To create a derived column in Azure Data Factory where the value depends on the content of another column follow the below steps:
According to the ask, I've created a new column target_attr to achieve the conditions:
Firstly, I've stored the CSV file in Azure Blob Storage.
Then set a linked service and create a dataset in ADF
Let it automatically detect the columns under Schema option.
Then create a Data Flow:
case(
source_attr == 'username', username,
source_attr == 'email', email,
''
)
3.Adding a Sink to preview output.
Finally turn on Data Flow Debug. Once Active, go to Data Preview and refresh it.
As you can see that I'm successfully able to fetch the Derived Column.