SSIS Expression Help

  • Hi,

    Need help. Here is my sample data

    ID,Fname,CellPhone,OtherPhone,OID

    1,Smith,2039131941,Null,1452

    2,James,(203)913-1941,2039131942,6458

    3,Chris,Null,(203)913-1943,1111

    Here is my requirement.

    If Length of CellPhone > 10 or < 10 or Null use OtherPhone

    If Lenght of OtherPhone > 10 or < 10 or Null use OID

    So far I have this expression in derived column

    ContactNumber = (Len(CellPhone) > 10 || Len(CellPhone) < 10 || isnull(CellPhone) ? OtherPhone : CellPhone : (Len(OtherPhone) > 10 || Len(OtherPhone) < 10 || isnull(OtherPhone) ? OID : OtherPhone ))

    I am not getting right result what I want, at the end I want below result (as an example)

    ID,Fname,ContactInfo

    1,Smith,2039131941

    2,James,2039131942

    3,Chris,1111

    Please advise.

    Thank You.

  • Here is the solution, May be someone want to know...

    LEN(CellPhone) == 10 && !ISNULL(CellPhone) ? CellPhone : LEN(OtherPhone) == 10 && !ISNULL(OtherPhone) ? OtherPhone : OID

Viewing 2 posts - 1 through 1 (of 1 total)

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