Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
nnaren
Contributor
Contributor

to generate an alphanumeric counter

I am trying to figure out a way in talend to generate an alphanumeric counter that creates numbers in the following way:

YYXXXXXXXX Where YY is calendar year XXXXXXXX is id which is alphanumeric counter (starting sequence number 00000001 to ZZZZZZZZ every year)

Every new year, 8 character ID should be reset and start again with 00000001

Sequence should appear like 00000001 00000002 00000003 ... 99999999

A0000001 A0000002 A0000003 ... A9999999

B0000001 B0000002 B0000003 ... B9999999

Z0000001 Z0000002 Z0000003 ... Z9999999 ...

ZA000001 ZA000002 ZA000003 ... ZA999999

...... ZZZZZZZZ The last number would be ZZZZZZZZ. So it would 1-9 first, then A-Z after that.

And the year the last id that we can accommodate in a year will be 20ZZZZZZZZ

kindly suggest a way to do this.

Labels (6)
5 Replies
Anonymous
Not applicable

Hello,

Please take a look at component: TalendHelpCenter: tRowGenerator which generates as many rows and fields as are required using random values taken from a list.

Best regards

Sabrina

 

nnaren
Contributor
Contributor
Author

Hello Sabrina,

 

I tried but i was not able to achieve, could you pls help with an example on how this can be achieved?

wcfsmart
Contributor
Contributor

I suggest you write a routine :

 

A0000002 = myRoutine.nextValue("A0000001")

B0000001 = myRoutine.nextValue("A9999999")

 

It should not be difficult to handle it with java

 

extract the 7 last char of the input param,

then convert to integer

if value <> 9999999 then add 1, complete with 0 and append to the first

else you handle using the first char ...

 

wcfsmart
Contributor
Contributor

Hello nnaren

 

have you tried using a routine?

is it working?

nnaren
Contributor
Contributor
Author

I am not much aware about routines.. I am new to talend