Transformer Stage Logic
Posted: Thu Jun 02, 2011 6:25 am
Hi All,
Need your suggestions on the following scenario. Considering we have the following input schema as
Input Schema:
StartDate
EndDate
Period1
Period2
Period3
.
.
.
Period30
Output Schema:
StartDate
EndDate
Period
Mapping:
StartDate -> StartDate
EndDate -> EndDate
(EndDate - StartDate) We get the no. of days and its only for one month. So it will be in between 1 to 30.
Based on no of days we get from the above subtraction we need to populate the respective Period Column to Output.
For ex: If the difference is 5 days (StartDate: 2011-06-06, EndDate: 2011-05-01: StartDate-EndDate=5) we need to populate Period5 from Source to Period column in Target.
This we can achieve with if then else in transformer but it will be tedious. Can anyone please help me achieving this in a better way?
Thank you,
Need your suggestions on the following scenario. Considering we have the following input schema as
Input Schema:
StartDate
EndDate
Period1
Period2
Period3
.
.
.
Period30
Output Schema:
StartDate
EndDate
Period
Mapping:
StartDate -> StartDate
EndDate -> EndDate
(EndDate - StartDate) We get the no. of days and its only for one month. So it will be in between 1 to 30.
Based on no of days we get from the above subtraction we need to populate the respective Period Column to Output.
For ex: If the difference is 5 days (StartDate: 2011-06-06, EndDate: 2011-05-01: StartDate-EndDate=5) we need to populate Period5 from Source to Period column in Target.
This we can achieve with if then else in transformer but it will be tedious. Can anyone please help me achieving this in a better way?
Thank you,