One Star

[resolved] How to add sequence/running number of duplicate data

Hi,
i have problem with duplicate data but there'a a way to avoid this duplicated. by add new sequence data for each data.
example :
Name
AA
AA
AA
BB
CC
DD
DD
i need.
Name | SubName
AA | 1
AA | 2
AA | 3
BB | 1
CC | 1
DD | 1
DD | 2
i have tFileInputExcel (1 column) -> ?? -> tFileOutputExcel (2 columns)
How could i proceed? Please help.
Thanks,
Rebacca.
1 ACCEPTED SOLUTION

Accepted Solutions
One Star

Re: [resolved] How to add sequence/running number of duplicate data

Try this in tMap new field:
Numeric.sequence(row1.Name,1,1)
5 REPLIES
Community Manager

Re: [resolved] How to add sequence/running number of duplicate data

Hi
You can use Numeric.sequence("s1",1,1) to generate a sequence number for each item on tMap. see my screenshots.
----------------------------------------------------------
Talend | Data Agility for Modern Business
Not applicable

Re: [resolved] How to add sequence/running number of duplicate data

Hi,
I Hope your requirement is to remove the Duplicate data in the Input Excel File.
Then you may simply use the component tUniqRow.
The Screenshot follows.
One Star

Re: [resolved] How to add sequence/running number of duplicate data

i'm using tMap and Numeric.sequence. it works.
Big thanks. Smiley Happy
One Star

Re: [resolved] How to add sequence/running number of duplicate data

i have used that tmap and Numeric.sequence("s",1,1) and iam getting
aa 1
aa 2
aa 3
bb 4
bb 5
cc6
so i want output as 
aa 1
aa 2
aa 3
bb 1
bb 2
cc 1
how does it is possible? world you please help in this regard? @shong
One Star

Re: [resolved] How to add sequence/running number of duplicate data

Try this in tMap new field:
Numeric.sequence(row1.Name,1,1)