Wednesday, February 26, 2014

SSIS: Derived Column

Add in Expression column
If single if else
(Active ==  0  ? "IAmNotActive" : "IamActive")
Where active is column name.

Second when you have multiple account:

(Age< 20 ? 1 :
(Age>= 20 && Age< 30 ? 2 :
(Age>= 30 && Age< 40 ? 3 :
(Age>= 40 && Age< 50 ? 4 :
5))))

means if (Age< 20){1}
else if (Age>= 20 && Age< 30) {2}
else if (Age>= 30 && Age< 40) {3}
else if (Age>=  40 && Age< 50 ){4}
else {5}
Where Age is column name

1 comment:

Tushar Sharma said...

Very useful Article .Keep it up Sir.