我需要根据2个属性(LAST_UPDATE和STAUS)显示最新状态 我怎么能在informatica中做到这一点?来源是平面文件
示例:
NUMBER --------------------LAST_UPDATE ----------------- STATUS
-----1 -----------------------01/26/2015 ---------------------- CREATED
-----1 ---------------------- 01/27/2015 ------------------UNDER_PROCCESS
-----1---------------------- 01/28/2015 ---------------------COMPLETED
-----2---------------------- 01/28/2015 ------------------ CREATED
-----3---------------------- 01/28/2015 --------------------- UNDER_PROCCESS
结果应为
NUMBER --------------------LAST_UPDATE ------------- STATUS ---------------LAST_STAUS
-----1 -----------------------01/26/2015 ---------------------- CREATED -----------COMPLETED
-----1 ---------------------- 01/27/2015 -----------------UNDER_PROCCESS ---- COMPLETED
-----1---------------------- 01/28/2015 ---------------------COMPLETED ----------COMPLETED
-----2---------------------- 01/28/2015 ------------------ CREATED ---------------- CREATED
-----3---------------------- 01/28/2015 -------------UNDER_PROCCESS --UNDER_PROCCESS
答案 0 :(得分:0)
您可以使用聚合器转换,也可以使用变量端口在表达式转换中进行转换。
使用joiner加入Aggregator和Sorter的输出。
SQ ----> Sorter -----> Agg----> Joiner ----> Target
|_____________________^
在表达式转换中:
NUMBER (i/o)
LAST_UPDATE (i/o)
STATUS (i/o)
v_LAST_STATUS (v) = IIF(STATUS<>v_PREV_STATUS, STATUS,v_PREV_STATUS)
LAST_STATUS (o) = v_LAST_STATUS
v_PREV_STATUS (v) = STATUS
确保端口顺序正确。