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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
_AnonymousUser
Specialist III
Specialist III

How to add unique batch ID to a job

Hi,
I want to add an Batch_ID to my job which runs daily. But this Batch ID should be unique for each run and needs to be incremental.
I created a variable which converts my job run start date into integer and gives me output in form of "yyyyMMdd". Now I want to add a unique number in front of this "yyyyMMdd", so that it serves as a BATCH_ID for that particular run. Point to be noted is, it should add only one number in front of "yyyyMMdd" for each run of the job, and should be incremental for the subsequent runs. I hope i have written my query very clearly.
I willbe grateful if someone could help me out.
Labels (2)
5 Replies
Anonymous
Not applicable

Hi 
If you want the batch_Id to be incremental for each run, you need to write batch_Id to somewhere such as file or database, read this batch_Id at the beginning of job, use this batch_id in the job and update it to the destination at the end of job.
Best regards
Shong
_AnonymousUser
Specialist III
Specialist III
Author

Hi Shong,
This is where I am stuck. The source file does not contain any Batch_ID. I had to add two new fields while mapping using tMap and again add an additional tMap to map those two newly added fields.
I am successfull till producing a batch_id derieved from the "job run date" column, but I am unable to add a unique number in front of this  derieved column which is same for all the rows mapped for that particular run.
Thanks though. I wish someone else might have faced this issue and came out with something innovative.
Anonymous
Not applicable

For the first run, the source file doesn't contain any batch_id, you can initialize a default value, and then, concatenate it with the 'job run date' string.
_AnonymousUser
Specialist III
Specialist III
Author

Thank you shong.
Anonymous
Not applicable

Hi Friend,

My name is shamly.

Could you please share a screenshot of this operation?

My source files don't have batch id. But I want to generate batch id for every file.

How can I achieve those?? Any screenshots please. I am very new to talend.