Posted: Sat Apr 11, 2009 11:46 pm Post subject: Merge the records based on the Span-date
We have input dataset with 80 byte size and it is sorted based on C1, C2, C3 as ASC and C4 as DESC. C4 is a Span Start date which has multiple Span Start date. And C5 is the span-end date. So, we have multiple records for the same C1, C2 and C3.
I want to merge those records into a single record. The multiple Span-start date and end-date will be another new column in the target file to make it a single row. Maximum 5 date span will be allowed in the merging and if more than 5 span for a particular C1,C2 & C3 then we will skip those extra 5 spans. Please see the example below.
Target file has only 5 occurrences of Start-date and End-date file, if any C1, C2, C3 has more than 5 records; it should accommodate only the first 5 starting and ending spans. The output file should be
Eventually, the output file has a unique record based on RC1, RC2 & RC3 and the duplicate records from the input file's Span start date and end-date will be merged with the respective date fileds in the output file. Maximum 5 date span (start & end) date will be allowed others skipped. Thanks for your help to find the logic.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum