0
votes

I have got file Data like this

Val     type 
7000    Main
7000.1  Spouse
7000.2  Child
7000.3  Child
7000.4  Child
8000    main
8000.1  Spouse

In Sql I have written Case Condition

Select CASE WHEN SUBSTRING(val,CHARINDEX('.',val))= 0 THEN 'main'
CASE WHEN SUBSTRING(val,CHARINDEX('.',val))= 1 THEN 'Spouse'
ELSE 'Child'

So it will give Main for not having Decimal values and 1 for Spouse and Rest are child But how can I write the same condition for Derived Column in SSIS package

1
That's case expressions, not case statements... - jarlh
Sorry Typo Mistake I will modify @jarlh - mohan111

1 Answers

0
votes

I think something like this.

FINDSTRING(val,".",1) == NULL(DT_WSTR,10) ? "Main" : SUBSTRING(val,FINDSTRING(val,".",1)+1,1) == "1" ? "Spouse" : "Child"