HomeForum
Welcome, Guest

Mapping one source line to multiple target lines(records)
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: Mapping one source line to multiple target lines(records)

Mapping one source line to multiple target lines(records) 1 year, 2 months ago #1901

  • Lisa
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
  • Karma: 0
Hello

I have file which holds contractors rates for specified period
it Has MonthStart and Month End

COntractorID,MonthStart,MonthEnd,Rate
100000000001,1,5,R1
100000000002,2,6,R2
100000000003,5,10,R4

What I want to create is monthly rate file like this one

How can I do it?

ContractorID,Month,Rate
100000000001,1,R1
100000000001,2,R1
100000000001,3,R1
100000000001,4,R1
100000000001,5,R1
100000000002,2,R2
100000000002,2,R2
100000000002,3,R2
100000000002,4,R2
100000000002,5,R2
100000000002,6,R2
100000000003,5,R4
100000000003,6,R4
100000000003,7,R4
100000000003,8,R4
100000000003,9,R4
100000000003,10,R4

Lisa

Re: Mapping one source line to multiple target lines(records) 1 year, 2 months ago #1924

  • admin
  • NOW ONLINE
  • Moderator
  • Posts: 2182
  • Karma: 12
I have created a working example for you

Basically it is a combination of calculation and unpivot object

Here is the calculation transformation I used

var
start_v : integer;
end_v : integer;
i: integer;
buffer: string;
begin
start_v:=[F001];
end_v:=[F002];
buffer:='';
For i:=start_v to end_v-1 do
buffer:=buffer+InttoStr(i)+',';
buffer:=buffer+InttoStr(end_v);
result:=buffer;
end;

Unzip everything into c:\support directory
  • Page:
  • 1
Time to create page: 0.18 seconds

Testimonials

"In my personal view, currently there are no other data transformation tools on the market that provide the same value for money as Advanced ETL Processor. The number of features is constantly increasing and If something is missing the will add it for you  ..."

Gabriell Mellotto, Senior ETL Consultant

User Login

You only need to log in or register to use our support forum



Our customers

BP

BBC

HSBC


Databases we work with

Go to top