Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SSIS Lookup-Is this the best option?


SSIS Lookup-Is this the best option?

Author
Message
mbrady5
mbrady5
SSC-Enthusiastic
SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)

Group: General Forum Members
Points: 129 Visits: 745
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
Phil Parkin
Phil Parkin
SSCrazy Eights
SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)

Group: General Forum Members
Points: 8300 Visits: 19448
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?


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
mbrady5
mbrady5
SSC-Enthusiastic
SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)

Group: General Forum Members
Points: 129 Visits: 745
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
Phil Parkin
Phil Parkin
SSCrazy Eights
SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)

Group: General Forum Members
Points: 8300 Visits: 19448
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?


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
mbrady5
mbrady5
SSC-Enthusiastic
SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)

Group: General Forum Members
Points: 129 Visits: 745
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):-)
Phil Parkin
Phil Parkin
SSCrazy Eights
SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)

Group: General Forum Members
Points: 8300 Visits: 19448
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.


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
mbrady5
mbrady5
SSC-Enthusiastic
SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)

Group: General Forum Members
Points: 129 Visits: 745
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!!!!
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search