Search code examples
sqlssisssis-2012ssis-2008

SSIS expression similar to case statement


I need to write an expression for derived column. My column name is 'status'. what is the equivalent expression in SSIS for the below condition?

Case when Status Like '%Open%' then 0 when Status like '%Won%' then 1 when status like "%Lost%' then 2 Else 3

Thanks in advance


Solution

  • Give this a shot:

    FINDSTRING(Status,"Open",1) > 0 ? 0 : (FINDSTRING(Status,"Won",1) > 0 ? 1 : (FINDSTRING(Status,"Lost",1) > 0 ? 2 : 3))