Ask a questionAsk a question
 

AnswerConditions in SSIS

  • Saturday, November 07, 2009 7:17 PMcollie12 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Hi,

    I am importing an excel file with a few columns. I want to add a derived column that will do something like the following:
    iif column1="2" and column3="y" and column4="p" then "Slow" elseif column1="6" and column3="x" and column4="row" then "Fast" else "Medium"
    How can i write the above in SSIS?

    Thanks

Answers

  • Sunday, November 08, 2009 1:02 AMNitesh Rai Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    ([column1] == "2" &&[column3] == "y" && [column4] =="p") ? "Slow" : (([column1] == "6" && [column3] == "x" && [column4] == "row") ? "Fast" : "Medium" )
    Nitesh Rai- Please mark the post as answered if it answers your question

All Replies

  • Saturday, November 07, 2009 7:45 PMKunal Joshi Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Proposed Answer
    Hi collie
    have ur derived column expression as
    col1 ==  2 && col3 ==  "y"  && col4 ==  "P"? "SLOW" : col1 ==  6 && col3 ==  "x"  && col4 ==  "row" ? "Fast" : "Medium"
    ____________________________________________________________
    Please mark post/s answered / help pul if they answer ur query - -Kunal
    • Proposed As Answer byKunal Joshi Sunday, November 08, 2009 4:15 PM
    •  
  • Sunday, November 08, 2009 1:02 AMNitesh Rai Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    ([column1] == "2" &&[column3] == "y" && [column4] =="p") ? "Slow" : (([column1] == "6" && [column3] == "x" && [column4] == "row") ? "Fast" : "Medium" )
    Nitesh Rai- Please mark the post as answered if it answers your question
  • Monday, November 09, 2009 1:16 PMBharani 3010 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Nitesh has provided the right expressions.

    Alternatively to know more about expressions refer here.


    Thanks, Bharani M - Please mark the post as answered if it answers your question. - Please vote the post as Helpful if you find the post as helpful.