Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am working on generating multiple excel output files and using numeric sequence in Tmap to generate sequence numbers. The sequence number for these records should be same across all the sheets.
e.g.,One of the output sheets is a phone numbers sheet and there are 10 records and some of them do not have phone numbers and are null.
So, I used tfilterRow to remove the null values and only pass the records which have phone numbers. The problem here is, the Sequence number that is generated for this Sheet is not the same as previous sheets.
For E.g., There are 10 customers and say 3,6 and 9 do not have a phone number, the sequence should generate as
Phone1
Phone2
Phone4
Phone5
Phone7, Phone8 and Phone10.
Instead the Talend is generating a sequence Phone1,2,3,4,5,6,7 etc.
I need a solution where the sequence number is not effected by the null records. If there is a null record, skip it and generate the next sequence number.
Thanks
SK
I think you can try generating your sequence numbers and associating them before removing the null values.
In my opinion that should work, otherwise i don't have any other idea right now.
you can generate a sequence in tmap itself and then use tfilterrow. So, your job should be like:
tmap with fields (phone_number,numeric.sequence("s1",1,1)) --> tfilterrow
Create Variable in tMap
row4.Mobile == null || row4.Mobile.equals("") ? 0 : Numeric.sequence("s2",1,1)
Thanks,
Sachin