79609042

Date: 2025-05-06 15:45:13
Score: 1
Natty:
Report link

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

enter image description here

Let it automatically detect the columns under Schema option.

Then create a Data Flow:

  1. Add a Source and choose the Dataset you created.

enter image description here

  1. Click + and add a derived column AddTargetAttr. Choose the Incoming stream accordingly. And add a new column target_attr with expression as :
case(
  source_attr == 'username', username,
  source_attr == 'email', email,
  ''
)

enter image description here

3.Adding a Sink to preview output.

enter image description here

Finally turn on Data Flow Debug. Once Active, go to Data Preview and refresh it.

enter image description here

As you can see that I'm successfully able to fetch the Derived Column.

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Mihir Saxena