• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » Generate a sequence in tMap

#1 2009-01-20 17:59:38

DjeCepap
Member
Registered: 2008-01-28
Posts: 24

Generate a sequence in tMap

How, in tMap, then I to load the field of a table with a numerical sequence which is initialized according to other fields'? 

Here are what I want to obtain
Field 1    ! Sequence
A    !    1
A    !    2
B    !    1    <- starts again to 1 because field 1 changed from A to B
B    !    2
B    !    3
T    !    1    <- starts again to 1 (Field 1 changed from B to T)
U    !    1    <- starts again to 1 (Filed 1 changed from T to U)

so on

Merci has all

Offline

#2 2009-01-20 22:01:06

Volker Brehm
Member
Registered: 2007-04-03
Posts: 1139
Website

Re: Generate a sequence in tMap

Hi,

you could use the function "Numeric.Sequence", the first parameter should be you key for the sequence ("Field 1").
The sequence is based on the key and not on the changed field. So if you add an row with field A at the end of your example the result would be 3.

Hope this helps.

Bye
Volker

Offline

#3 2009-02-11 17:54:25

DjeCepap
Member
Registered: 2008-01-28
Posts: 24

Re: Generate a sequence in tMap

Thinks for Volker Brehm

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » Generate a sequence in tMap

Board footer

Powered by FluxBB