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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Reset Numeric Sequence For Each tFlowToIterate row

Hi.

I have a job which brings back lists from a website.

For each list that is brought back, I am feeding the lists into SQL database tables (a table for each list).

The tables are created by the tDBOutput component (table dropped and recreated each time).

I am trying to apply a numeric sequence for each of the lists to set an ID column. It is working fine, except the fact that the numeric sequence does not get reset for each row the flow iterates over.

For example, list 1 contains 10 rows, so the ID column for Table1 has IDs 1 to 10

The table for List2 start its numeric sequence then at 11, instead of resetting to 1.

This is screenshot of my job

0693p000009Hv6IAAS.png

Here's the tMap that applied the numeric sequence

0693p000009Hv6SAAS.png

Why doesn't the numeric sequence reset to 1 for each row the flow iterates over? and how to I make sure each table's numeric sequence starts at 1 ?

Thanks in advance

Steve

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi

You need to set a dynamic sequence name, eg:

Numeric.sequence(""+((Integer)globalMap.get("tFlowToIterate_1_CURRENT_ITERATION")),1,1)

 

Then, the sequence will start from 1 for each iteration.

 

Regards

Shong

View solution in original post

3 Replies
Anonymous
Not applicable
Author

Hi

You need to set a dynamic sequence name, eg:

Numeric.sequence(""+((Integer)globalMap.get("tFlowToIterate_1_CURRENT_ITERATION")),1,1)

 

Then, the sequence will start from 1 for each iteration.

 

Regards

Shong

Anonymous
Not applicable
Author

Thanks @Shicong Hong​ I will give this a try.

Anonymous
Not applicable
Author

Hi @Shicong Hong​ 

I have now tried this, and this has sorted the issue. Many thanks for your help.

Regards

Steve