splitssisgoogle-cloud-dataflow

SSIS split condition expression in data flow


I want to create a split condition where I check if the records in a column called Year are a 4 digit year, say 2023. The column also contains other bad data like "abcd", so I need to filter out anything that is not a 4 digit number. Could someone show me how to create the expression?


Solution

  • You could use a Derived Column Transformation. For the expression enter: (DT_I2)LEFT(LTrim([Year]),4)

    This attempts to cast the Year value to a 2 byte integer. Any rows that cannot be cast as integer (they contain characters instead of numbers) will fail the conversion. So then you configure the error output of this Derived Column to redirect those rows to a different table.