Max Value in Lookup Transformation

  • I am working on learning SSIS and translating my DTS packages into SSIS.  I have a lookup transformation that finds the max value of a column.  That is what I want as my output column.  Unless I just select all the values the Lookup transformation object gives me errors.  Can anyone tell me how to do this?

    THanks,

    Eva

  • How are you using a lookup to find the max? Why not use the aggrigate component?

    Cheers,CrispinI can't die, there are too many people who still have to meet me!It's not a bug, SQL just misunderstood me!

  • Because what I need is the maximum value from one database based on values from my source data.  The aggregate component just lets me find the aggregrate value from the source data.  It doesn't allow for transformations which is really what I need.

  • Then your lookup would use a query Select Max(Col1) as Col1, Col2... Group By Col2.

    You would then join that onto your source data.

     

    BTW: Post the error. Not much point in saying "it gives me an error" and don't post anything.

    Cheers,CrispinI can't die, there are too many people who still have to meet me!It's not a bug, SQL just misunderstood me!

  • Crispin,

    I wanted to thank you for replying.  In the end you didn't exactly give me the answer but you got my mind working and pointed me in the right direction.  I ended up using a lookup to get the value I needed then added an aggregate to pull the max value.  I was trying to do in one step what really took two.

    I don't think I would have gotten there without your comments.

    Thank you very much.

    Eva

Viewing 5 posts - 1 through 4 (of 4 total)

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