Date Comparison between group of input and Reference Records
Posted: Sun Jun 25, 2017 9:01 pm
Hi Team,
I need some help in doing this date comparison logic for the given input and reference file.
For the grouping rows on Column1 and Column2, i need to compare the from date and term date in input file with the reference file From date and Term Date. If the input file From date and Term date in the group falls within the Reference group rows Date column, then i need to pass the input as is to the Output.
Groupby Columns: Column1 and Column2 only
Inp file:
Column1, Column2, Colum3, Column4, FromDate, TermDate
10, 100, ABC, 123, 20170101, 20170301
10, 100, DEF, 988, 20170302, 20170701
10, 100, GHI, 895, 20170702, 20180101
Reference File:
Column1, Column2, Colum3, Column4, FromDate, TermDate
10, 100, ABC, 123, 20170101, 20170301
10, 100, DEF, 988, 20170302, 20170701
Expected Output: As the input rows From date and Term Date falls with in the From date and Term date of the Reference File. All the matched input rows to go the Target File.
Column1, Column2, Colum3, Column4, FromDate, TermDate
10 100 ABC 123 20170101 20170301
10 100 DEF 988 20170302 20170701
10 100 GHI 895 20170702 20180101
Any idea on implementing this logic would be of great help..
Thank You
Senthil
I need some help in doing this date comparison logic for the given input and reference file.
For the grouping rows on Column1 and Column2, i need to compare the from date and term date in input file with the reference file From date and Term Date. If the input file From date and Term date in the group falls within the Reference group rows Date column, then i need to pass the input as is to the Output.
Groupby Columns: Column1 and Column2 only
Inp file:
Column1, Column2, Colum3, Column4, FromDate, TermDate
10, 100, ABC, 123, 20170101, 20170301
10, 100, DEF, 988, 20170302, 20170701
10, 100, GHI, 895, 20170702, 20180101
Reference File:
Column1, Column2, Colum3, Column4, FromDate, TermDate
10, 100, ABC, 123, 20170101, 20170301
10, 100, DEF, 988, 20170302, 20170701
Expected Output: As the input rows From date and Term Date falls with in the From date and Term date of the Reference File. All the matched input rows to go the Target File.
Column1, Column2, Colum3, Column4, FromDate, TermDate
10 100 ABC 123 20170101 20170301
10 100 DEF 988 20170302 20170701
10 100 GHI 895 20170702 20180101
Any idea on implementing this logic would be of great help..
Thank You
Senthil