Ask a questionAsk a question
 

AnswerLookup not working as expected

  • Wednesday, November 04, 2009 8:22 AMcollie12 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi,

    I have a lookup where i check if order exists. If an order doesn't exist i want to redirect the rows to a certain step in the data work flow and orders that do exist i want to redirect to another step in the data work flow. However, the lookup for some reason redirects all rows to the same step and doesn't split the orders to the steps i want. I tried none and partial cache but that doesn't help either.
    Any ideas?

    Thanks

Answers

  • Wednesday, November 04, 2009 1:37 PMPhil BrammerMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    If the lookup fields (the ones you are trying to match) are character fields, remember that the lookup component does CaSE sensitive matching, and will honor trailing white spaces, so in cases like this, it is always best to:

     - UPPER/LOWER case both sides of the lookup.  You can use a derived column to do this on the data flow side, and you can use the UPPER/LOWER function in a SQL statement to do the lookup side.
     - LTRIM(RTRIM()) the data on both sides.  Again, you can use the derived column from above to combine these two steps.  Same for the SQL statement in the lookup.


    Phil Brammer | http://www.ssistalk.com | Twitter: http://twitter.com/PhilBrammer

All Replies

  • Wednesday, November 04, 2009 8:28 AMBharani 3010 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Can you double check on the data that flows in and the data against which it is compared?

    Did you placed a conditional split to split the output of the lookup into two one for matched orders and other for unmatched orders?(Ignore failure should be set for this type)
    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.
  • Wednesday, November 04, 2009 8:54 AMNitesh Rai Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    So you mean that all the records from lookup goes to one output (red or green).
    Where does all the records going to? (Red or Green op)
    Try with default full cache mode only.
    Have you checked for Null values of the column used as Join ccondition?
    Are you taking care of case and empty spaces? (Lookup in full cache mode is case sensitive)?

    Nitesh Rai- Please mark the post as answered if it answers your question
  • Wednesday, November 04, 2009 9:15 AMSudeep Raj Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi,

    I have a lookup where i check if order exists. If an order doesn't exist i want to redirect the rows to a certain step in the data work flow and orders that do exist i want to redirect to another step in the data work flow. However, the lookup for some reason redirects all rows to the same step and doesn't split the orders to the steps i want. I tried none and partial cache but that doesn't help either.
    Any ideas?

    Thanks

    Are all the records going in the error output?
    Trim the data and convert the comparson column in source and lookup table to upper or lower case as it is case sensitive.
    Hope this helps !!
    Sudeep   |    My Blog
  • Wednesday, November 04, 2009 1:37 PMPhil BrammerMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    If the lookup fields (the ones you are trying to match) are character fields, remember that the lookup component does CaSE sensitive matching, and will honor trailing white spaces, so in cases like this, it is always best to:

     - UPPER/LOWER case both sides of the lookup.  You can use a derived column to do this on the data flow side, and you can use the UPPER/LOWER function in a SQL statement to do the lookup side.
     - LTRIM(RTRIM()) the data on both sides.  Again, you can use the derived column from above to combine these two steps.  Same for the SQL statement in the lookup.


    Phil Brammer | http://www.ssistalk.com | Twitter: http://twitter.com/PhilBrammer