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

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • 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