How to set the expression with three or more conditions - Azure Data Flow

Kakehi Shunya (筧 隼弥) 201 Reputation points
2023-01-12T11:58:54.7833333+00:00

Hi.

I wanted write expression in mapping dataflows equivalent to:

If
MONTH = 'Jan_23' Then Horizon_week = 'W1'
Else if
MONTH = 'Feb_23' Then Horizon_week = 'W5'
Else if
MONTH = 'Mar23' Then Horizon_week = 'W9'
Else if...
.
.
.
Else if 'Dec23' Then Horizonweek = 'W48'

I set expression in delivered column activity, but it doesn't work.

User's image

iif(MONTH == 'Jan_23','W1',iif(MONTH == 'Feb_23','W5',iif(MONTH == 'Mar_23','W9',iif(MONTH == 'Apr_23','W14',iif(MONTH == 'May_23','W18',iif(MONTH == 'Jun_23','W22',iif(MONTH == 'Jul_23','W27',iif(MONTH == 'Aug_23','W31',iif(MONTH == 'Sep_23','W35',iif(MONTH == 'Oct_23','W40',iif(MONTH == 'Nov_23','W44',iif(MONTH == 'Dec_23','W48'))))))))))))

Can anyone solve this?

Any answer would be helped.

Thank you.

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,150 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,159 questions
0 comments No comments
{count} votes

Accepted answer
  1. Nasreen Akter 10,811 Reputation points
    2023-01-12T20:33:23.4566667+00:00

    Hi @Kakehi Shunya (筧 隼弥) ,

    I think you missed ELSE value in the Last IF statement. Thanks!

    .... iif(MONTH == 'Dec_23','W48'))))....


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.