Generate Numeric Sequence using Variable (Not Function)

Highlighted
Five Stars

Generate Numeric Sequence using Variable (Not Function)

I need to generate Numeric seq. ( integer ) without using Numeric.Sequence() function.

for Example :

input Data : only 1 column (string ) "name" , has 5 values , A,B,C,D,E

Output :  id(int)  Name(string)

                1           A

                2          B

                  ........

                5         E.

I need to use variable , expression using tMap (or other suitable components).

 

Regards 

Subhadeep

Tags (1)
Employee

Re: Generate Numeric Sequence using Variable (Not Function)

Hi,

 

     May I know the reason why internal numeric sequence is a problem for you?

 

     If it is a scenario where you would like to start from last loaded sequence number (like in a DB), you can pick that value first from DB and load to a context variable. Then you can start the sequence from the loaded value instead of 1.

 

Numeric.sequence("s1",context.last_value,1)

 

Warm Regards,

 

Nikhil Thampi


Warm Regards,
Nikhil Thampi
Please appreciate our members by giving Kudos for spending their time for your query. If your query is answered, please mark the topic as resolved :-)
Five Stars

Re: Generate Numeric Sequence using Variable (Not Function)

Hi nikhilthampi, 

 

the scenario demands to avoid the inbuilt function , can you please give me the solution using variables in expression builder ?

 

Thanks in advance .

 

Regards 

Subhadeep 

Employee

Re: Generate Numeric Sequence using Variable (Not Function)

Hi Subhadeep,

 

     Could you please me more context why the sequence function cannot be used for your use case scenario?

 

     If you could explain your specific scenario in detail, we can provide a better solution. All normal scenarios can be handled by above function including the sequence number generation from a specific number instead of 1.

 

     I am really interested in a scenario where this function should not be used.

 

Warm Regards,

 

Nikhil Thampi


Warm Regards,
Nikhil Thampi
Please appreciate our members by giving Kudos for spending their time for your query. If your query is answered, please mark the topic as resolved :-)

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.