0

Here I am checking the control flag if the flag is Yes then I need to pass 1 and if the flag Is no then I need to pass 0 from the derived column, this is my column. it is passing only 0 even though the flag is Yes

DerivedColumnName  Derived Column       Expression                      DataType
CopySerial_Control <Add as newcolumn>   Serial_Control == "Yes"? 1: 0   Four-Byte  
  • Are there any spaces? Does TRIM(Serial_Control) give the right result? – Chris Mack Sep 18 '17 at 18:26
  • No It didn't help , still its not passing after adding the TRIM(Serial_Control) == "YES"? 1: 0 – user7823107 Sep 18 '17 at 18:34
  • I noticed you're using different cases, are you getting the case right? SSIS expressions are case-sensitive. – Chris Mack Sep 18 '17 at 18:40
  • Yes I am getting the case right – user7823107 Sep 18 '17 at 18:46
  • Your expression is fine and works for me, I can't see any issues in what you've posted. Have you tried enabling the data viewer in your data flow to see if that reveals anything? – Chris Mack Sep 18 '17 at 18:48
  • I am new to SSIS, how do I enable the data viewer – user7823107 Sep 18 '17 at 18:49
  • UPPER(LEFT(trim(Serial_Control),1)) == "Y" ? 1: 0 --> This is overkill. – KeithL Sep 18 '17 at 18:52
  • To enable data viewer click on the connection and enable data viewer – KeithL Sep 18 '17 at 18:55
  • To enable the dataviewer, right-click the arrow before your Derived Column transformation, and you'll see it on the menu. Do the same with the arrow after the Derived Column. You'll be able to see precisely what's going in, and what's coming out. (You'll need to run the Data Flow task in debug mode, and screens will pop up with the data.) – Chris Mack Sep 18 '17 at 18:55
  • UPPER(LEFT(trim(Serial_Control),1)) == "Y" ? 1: 0 --> This is overkill. – KeithL Thanks Keith this one worked and I am aable to get the value 0 now – user7823107 Sep 18 '17 at 19:19
  • One thing you could do now is remove the "overkill" parts one by one, to identify where you original issue was. E.g., `UPPER(LEFT(trim(Serial_Control),2)) == "YE" ? 1: 0`. – Chris Mack Sep 20 '17 at 10:53

0 Answers0