简体   繁体   English

按日期和时间对数据进行排序,然后选择下一个最小日期以更新informatica中的另一个日期列

[英]Sort data by date & time and then select the next min date to update the other date column in informatica

Have Data like this This is a teradata table which is my source in informatica 具有这样的数据这是一个Teradata表,这是我在informatica中的来源

 S_ID      A_ID     START_DATE          END_DATE      STATUS

   1          a         01-02-2017         01-03-2017     CLOSED

   1          a         01-03-2017         31-12-9999     CLOSED       

   1          b         01-04-2017         31-12-9999     CLOSED

   1          c         01-05-2017         31-12-9999     ACTIVE

Now my requirement is this set of data below: how can i use or modify my source table to get the below results which is also a table in Teradata (i can also use a sqloverride in source qualifier) 现在,我的要求是下面的数据集:如何使用或修改源表以获取以下结果,该结果也是Teradata中的表(我也可以在源限定符中使用sqloverride)

 S_ID      A_ID     START_DATE          END_DATE      STATUS

   1          a         01-02-2017         01-03-2017     CLOSED

   1          a         01-03-2017         01-04-2017     CLOSED       

   1          b         01-04-2017         01-05-2017     CLOSED

   1          c         01-05-2017         31-12-9999     ACTIVE

只需使用表达式转换来填充发送出去的END_DATE,即在END_DATE_OUT端口中使用IIF语句即可:

IIF(STATUS = 'CLOSED', ADD_TO_DATE(START_DATE, 'MM', 1), END_DATE)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM