Page 1 of 1
column swaping
Posted: Tue Jan 29, 2008 2:35 am
by pratik.470
Hi,
Source=table(t1) has col1,col2
Target=table(t2) has col3,col4
normal mapping (col1=>col3) and (col2=>col4)
on lookup[meeting some conditions] the column must be swapped ie.(col1=>col4) and (col2=>col3)
how to design....eny suggestion.
Thanks in adv,
Pratik.
Re: column swaping
Posted: Tue Jan 29, 2008 2:52 am
by fyaqq
pratik.470 wrote:Hi,
Source=table(t1) has col1,col2
Target=table(t2) has col3,col4
normal mapping (col1=>col3) and (col2=>col4)
on lookup[meeting some conditions] the column must be swapped ie.(col1=>col4) and (col2=>col3)
how to design....eny suggestion.
Thanks in adv,
Pratik.
Can't you just put the logic in the derivation of the target.
For example, in col3's derivation ,put
if meet_condition Source.col2 else Source.col1
Posted: Tue Jan 29, 2008 6:25 am
by asitagrawal
Hi,
One more way could be like this..
Create two output links from the transformer, one with normal mapping (col1=>col3) and (col2=>col4) and second link with on lookup[meeting some conditions] the column must be swapped ie.(col1=>col4) and (col2=>col3) Add the lookup[meeting some conditions] as the constraint of the transformer... later use Link collector.
HTH.
Posted: Tue Jan 29, 2008 8:01 am
by chulett
That's unnecessary complication. The first answer is more appropriate, simply check the lookup status and swap values in each derivation based on the result of that check.
Posted: Tue Jan 29, 2008 8:42 am
by asitagrawal
I just presented an alternative..
![Idea :idea:](./images/smilies/icon_idea.gif)
Posted: Tue Jan 29, 2008 8:46 am
by chulett
Of course.
![Exclamation :!:](./images/smilies/icon_exclaim.gif)
Posted: Tue Jan 29, 2008 1:01 pm
by pratik.470
Hi,
Thanks..
![Smile :)](./images/smilies/icon_smile.gif)
Posted: Wed Jan 30, 2008 4:42 am
by asitagrawal
Remember to mark the topic as resolved...
![Smile :)](./images/smilies/icon_smile.gif)
Posted: Wed Jan 30, 2008 4:44 am
by asitagrawal
Remember to mark the topic as resolved...
![Smile :)](./images/smilies/icon_smile.gif)