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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
_AnonymousUser
Specialist III
Specialist III

Numeric sequence reset

Hello,
i am using a variable inside a tMap like this ---> Numeric.sequence("s1",1,1) * 10
so for each record processed i get 10, 20 ,30 and so on
the problem is that i need to reset this sequence each time i launch the job...
when launching the job from inside talend, the sequence is correctly resetted but if i export my job as
webservice, the sequence never resets.
is it possible to resolve this problem? Thanks in advance.
Labels (2)
11 Replies
_AnonymousUser
Specialist III
Specialist III
Author

can anyone help?
_AnonymousUser
Specialist III
Specialist III
Author

up
amaumont
Contributor III
Contributor III

I suggest you to add a feature to improve it.
Yet, you can duplicate Numeric routine and add a method such as:
    public static void resetSequence(String seqName, int startValue) {
seq_Hash.put(seqName, startValue);
}
_AnonymousUser
Specialist III
Specialist III
Author

thanks a lot, it worked!
i created a new Routine, i copied Numeric routine code and i added this method:
public static void resetSequence(String seqName){
seq_Hash.put(seqName, 0);
}
Then i call the method from a tava component. Thanks again for your answer
amaumont
Contributor III
Contributor III

Please create a feature to improve the product even this method works, it will improve the product for the next release, thank you.
Anonymous
Not applicable

When I try to install this routine, the "seq_Hash.put(seqName, 0);" part get's red-underlined. seq_Hash in particullar.. Any ideas why my TIS 3.2 doesn't have that Java class? Is there any particullar class I need to import on the top of the routine package??
Help would be much appreciated.
_AnonymousUser
Specialist III
Specialist III
Author

You should copy sequence related code from Numeric system routine, add new method and use your routine instead of system.
Anonymous
Not applicable

This may be an old post, but it saved my days of work. Thanks to all that contribute back to the forum.
Anonymous
Not applicable

There's a function to do this now.