Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have an excel input file with customer names, and I am trying to generate sequence numbers. This is what I am getting right now
CustomerName SequenceGenerated
ABC P1001
ABC P1002
XYZ P1003
But the output I want is as follows:
CustomerName SequenceGenerated
ABC P1001
ABC P1001
XYZ P1002
Thanks.
Hi,
You'll probably need to read in the Customer Name data rows as a pre-step, get the unique customer names, generate the sequence from the unique list, then use tMap, to join the list of unique values and customer name back into the source:
1/ excel -> tuniq -> tJavaRow (generate sequence) -> hash or fileoutput
2/ excel -> tmap (join in hash or file from step one) -> output
Thanks
David
I have just provided sample data, there are multiple customers with same name. Some of the customers have repeated 18 times.
CustomerName
ABC
ABC
ABC
ABC
Yup, and when you feed those through the tUniqRow, they will get resolved down to one row:
In: A,A,A,A,A,B,B,B,B,B,C,C,D,D,A,,A,B,B,C,D,E
Out: A,B,C,D,E
You then generate the the sequence for these unique names.
Unless I'm completely missing what you're after.
I need those multiple customers with same name listed in the output. I am not looking to get only unique records.
Thanks
Yup, as per my original reply, step 1 - you get the unique customer names, generate the sequence on those, save into a hash or output file (lets call this unique customer sequences), step 2 - re-read the source data and join in the unique customer sequences.