USING IF IN MAPPING DATA FLOWS

Mike Kiser 1,536 Reputation points
2021-07-27T20:28:06.563+00:00

Hi! @MarkKromer-MSFT (or anyone who can answer this :-)

I am running out of time so I hope you don't mind another Mapping Data Flow question. I have been working on this but no solution. I have the following data, Native, Naturalized, etc shown below. They have to be mapped to my ADF Mapping Data Flow Output csv document so that 1 shows for Native, 2 for Naturalized and so on. How can I do this with Data Flows? I tried if but it didn't work.

1--> Native
2--> Naturalized
3--> Alien Permanent
4--> Alien Temporary
5--> Alien
N-->Not Indicated

Thanks!
Mike Kiser

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,712 questions
0 comments No comments
{count} votes

Accepted answer
  1. Mark Kromer MSFT 1,146 Reputation points
    2021-07-27T21:40:10.737+00:00

    Are you trying to map the strings (Native, Naturalized ...) to an enum value (1,2,...)?

    If so, how about a case statement? https://learn.microsoft.com/en-us/azure/data-factory/data-flow-expression-functions#case

    i.e.

    case (
    column == 'Native', 1,
    column == 'Naturalize', 2,
    .
    .
    .
    )


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.