简体   繁体   中英

Previous Workflow Start Time as start date in a filter in Informatica PowerCenter

Ok, the situation looks like this: I have one workflow which is running many mappings. In those mappings, I need to have a filter that sets a certain delta load time for remigration data from salesforce to the oracle database. For the initial loading of the data we set a filter like the following:

CreatedDate >= TO_DATE('01/01/1900','MM/DD/YYYY') and CreatedDate <= $$EXPORTDATE

Where $$EXPORTDATE is assigned to a workflow variable in Workflow Manager referring to the WORKFLOWSTARTTIME . Now for the delta load of the remigration data I need to use the start time of the previous run as the start date (for the next run of the workflow).

For this purpose, we created an oracle database table where we put in manually the start date of the runs. This table only has two columns RECID and EXPORTDATE . They do not have any common columns with any of the objects or tables I am working with. The task is to use this table for setting the start date in the filter.

How can I do this? Is it maybe possible with a Lookup, I tried that but it didn't work out?

You can do -

  1. If your source and this oracle table is in same DB, you can use it directly. If in other Oracle DB link to connect to Oracle and use it directly from that table.
select * from source, oracle_datetab@Oracle_DB OraDT where CreatedDate >= TO_DATE('01/01/1900','MM/DD/YYYY') and CreatedDate <= OraDT.EXPORTDATE
  1. You can use Lookup and then filter. Lookup will be unconnected and join condition should be on dummy data. And the filter data based on that. Return EXPORTDATE. Lkp Query -
select -99 as dummy_join_condition, EXPORTDATE as EXPORTDATE from oracle_datetab

Join condition should be based on dummy_join_condition. Then use filter transformation -
CreatedDate <=:lkp.LKP_oracle_datetab(-99)
If you face any issues pls let me know.

  1. Third option is to use a joiner with source based on dummy column.
SQ1_source - create a dummy column with value = -99          --->
                                                                  JNR on this dummy column.  --> FIL on CreatedDate <= SQ2.EXPORTDATE
SQ2_oracle_datetab - create a dummy column with value = -99  ---> 

thank you very much for your suggestions, indeed I used the third option and it worked well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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