Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
ajithsachin
Partner - Contributor II
Partner - Contributor II

Serial Number Generation In Load Script

Hi All,

     I need to create a serial number in the load script , but i need to reset to this again 1 when there is a change in the code.

     Suppose my table is like this

     itemcode,supplier

     in this load when itemcode change that time need to reset the serial number to 1.

     Can anybody help.

Regards,

Ajith

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

This code should do it:

LOAD

     ...

     itemcode,

     supplier,

     if(itemcode = previous(itemcode), peek('serialno') + 1, 1) as serialno,

     ...

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

2 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

This code should do it:

LOAD

     ...

     itemcode,

     supplier,

     if(itemcode = previous(itemcode), peek('serialno') + 1, 1) as serialno,

     ...

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
ajithsachin
Partner - Contributor II
Partner - Contributor II
Author

Thank You.