SSIS Lookup-Is this the best option?

  • I am trying to make a change to my ssis data flow. The reality is that I'm stuck.

    My data flow problem has to do with currency exchange. I realized that I needed to be able to convert Canadian dollars to US Dollars and I will need to reference an exchange rate table when the 'Currency Code' = 'CAD'(Canadian).

    So I have a column in my data that holds the currency code which happens to be only US and CAD. What I'd like to do is;

    when Currency code = 'CAD', have it look up the rate in the exchange rate table and append it to the exchange rate column.

    I know the way I wrote it is a bit confusing but I figure it will at least start the dialogue. Is the lookup a good starting point?

    Thanks

  • Sounds like a textbook use for the lookup transformation to me - go for it.

    Do you have specific questions about how to set things up?

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Thanks Phil,

    I definitely have questions. It's late on Friday and my logic has gone out the window.

    My questions are basically,

    1.where do I put it within my data flow

    Ex: My data flows goes like this;

    1.Load Invoice and payment data

    2. Sort Invoice and payment data

    3. Join Invoice and Payment Data

    4. Convert the Data

    5. Set defaults and derived columns

    6. Load in the Destination

    2. My Invoice Data has the Currency Type.

    IF the currency type = 'CAD' then I want to look at a View and append the Rate for the Matching date to the data befor it goes to the destination.

    Hope this makes sense...and Thanks

  • Yeah that makes sense.

    I don't think it matters much where you put it - maybe between (4) and (5) would work well.

    Regarding the lookup itself - will there be an exact match in the exchange lookup table for every currency/date combination in the source data?

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • There will not be an exact (date match) in the exchange view. This is updated once per week.

    What I was thinking about doing is adding a week and year number column to the source and the lookup view so I could match on that?

    What confuses me the most is the logic for the lookup and how it works.

    Any good starting points? (Besides dragging it on the canvas):-)

  • mbrady5 (2/22/2013)


    There will not be an exact (date match) in the exchange view. This is updated once per week.

    What I was thinking about doing is adding a week and year number column to the source and the lookup view so I could match on that?

    What confuses me the most is the logic for the lookup and how it works.

    Any good starting points? (Besides dragging it on the canvas):-)

    There's no magic in it - all that you are doing is matching one or more columns in your source data to one or more in the lookup table (think of it as an inner join) - and then including any other columns (in your case exchange rate) from the lookup table in your data flow.

    But it needs to be an exact match, one way or another. If it were me, I would probably use a date tally table to 'explode' the currency view to include all dates and then match against that.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • I love the idea of a date tally table. Great idea. I will create one and hopefully that will be a great place to start.

    Thanks a lot!!!!

Viewing 7 posts - 1 through 6 (of 6 total)

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