SSIS Derived Columns

  • Hi

    I have an SSIS package which runs an insert/update

     

    I need to check if 4 fields(Boolean) are all set to False, if so then set another field(Boolean) to false as well showing the record to be inactive. I have tried the following but does not work.

    Field

    • IsActive - This needs to be set to false is all the fields below are false or set to true is 1 or more field is true
    • SafetyBaseline
    • RegulationBaseline
    • EnvironmentSafetyBaseline
    • EnvironmentSecurityBaseline

    The following does not work

    IsActive== False && SafetyBaseline ==  FALSE  && RegulationBaseline ==  FALSE  && EnvironmentSafetyBaseline ==  FALSE  && EnvironmentSecurityBaseline ==  FALSE

    Can someone help??

     

    Regards

  • Not tested, but the syntax will be more like this:

    (SafetyBaseline ==  FALSE  && RegulationBaseline ==  FALSE  && EnvironmentSafetyBaseline ==  FALSE  && EnvironmentSecurityBaseline ==  FALSE) ? IsActive = False: IsActive = TRUE

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Hi Phil

    Thanks for the update, worked a charm.

    Regards

     

     

  • You want IsActive to be true if any of the four other values are TRUE, and FALSE only when they are all FALSE.  If those are truly Boolean data types, you can just OR them together.

    IsActive = ( SafetyBaseline || RegulationBaseline || EnvironmentSafetyBaseline || EnvironmentSecurityBaseline )

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply