Scenario:
have an 3 tables
ENO ENAM HIREDATE
001 XXX MAY/25/2009
002 JJJJ OCT/12/2010
008 KKK JAN/02/2011
006 HJJH AUG/12/2012
ENO S-ID
001 OO
002 OO
007 OO
ENO V-ID
006 DD
008 DD
001 DD
Using informatica source qualifier or other transformations I should be able to club the above tables in such a way that if the HIREDATE>JAN/01/2011 then eno should select v-id and if HIREDATE<JAN/01/2011 the ENO should select s-id and make a target table leaving the ID columns blank based on condition IT SHOULD HAVE EITHER S-ID OR V-ID BUT NOT BOTH .
ENO ENAM HIREDATE S-ID V-ID
Please give me the best advice for the following situation.
Solution:
Better u do it in source qualifier sql query by case statement
select ENO,ENAM,HIREDATE,
CASE
WHEN (HIREDATE<JAN/01/2011
THEN table2.s-id
ELSE table3.s-id
END
from table1 a,table2 b,table3 c
where a.eno=b.eno
and b.eno=c.eno;
You can use lookup .
Second table and third table can be used as lookup.
In an expression:
s_id= IF (HIREDATE<JAN/01/2011, lkp_2nd_tbl,NULL)
v_id=IF(HIREDATE>JAN/01/2011,lkp_3rd_table,NULL )
have an 3 tables
ENO ENAM HIREDATE
001 XXX MAY/25/2009
002 JJJJ OCT/12/2010
008 KKK JAN/02/2011
006 HJJH AUG/12/2012
ENO S-ID
001 OO
002 OO
007 OO
ENO V-ID
006 DD
008 DD
001 DD
Using informatica source qualifier or other transformations I should be able to club the above tables in such a way that if the HIREDATE>JAN/01/2011 then eno should select v-id and if HIREDATE<JAN/01/2011 the ENO should select s-id and make a target table leaving the ID columns blank based on condition IT SHOULD HAVE EITHER S-ID OR V-ID BUT NOT BOTH .
ENO ENAM HIREDATE S-ID V-ID
Please give me the best advice for the following situation.
Solution:
Better u do it in source qualifier sql query by case statement
select ENO,ENAM,HIREDATE,
CASE
WHEN (HIREDATE<JAN/01/2011
THEN table2.s-id
ELSE table3.s-id
END
from table1 a,table2 b,table3 c
where a.eno=b.eno
and b.eno=c.eno;
OR
You can use lookup .
Second table and third table can be used as lookup.
In an expression:
s_id= IF (HIREDATE<JAN/01/2011, lkp_2nd_tbl,NULL)
v_id=IF(HIREDATE>JAN/01/2011,lkp_3rd_table,NULL )
Comments
Post a Comment