SSIS Derived Column transformation REPLACE and CAST in one expression

I need to replace and cast the data in a data set column and would like to do this using the Derived Column Transformation. I know how to do it with multiple derived column and a data conversion task how I believe it should be possible with a single derived column task.

The challange is that the columns contain the following DT_STR values:
 - No
 - Yes
 - No Value
and I would like to replace these with a simple boolean to safe space in my DB

I know I need to do something like this:

(DT_BOOL) REPLACE(beta, "No Value", "")

However that doesn't cover the No/Yes conversion to boolean.
Who is Participating?
Reza RadConnect With a Mentor Consultant, TrainerCommented:
you can also use only one derived column transformation, with this expression:
beta == "No Value" ? NULL(DT_BOOL) : (beta == "Yes" ?  TRUE  :  FALSE )

Reza RadConsultant, TrainerCommented:
add two derived column tranformation,
in first one, replace all "No Value" s with null
in second one,replace all "Yes' s with true, and "No" s with false.

does it make sense to you?

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.