Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator
Creator

Load script to populate unique row numbers

Hi,

My data set looks like this.

IDCUSTCITY
ID-1CCTY-1
ID-1C-1CTY-1
ID-2C-2CTY-2
ID-3C-3CTY-3
ID-4C-3CTY-4

 

I need to write a load script that adds a row# column to this table in the following manner.

IDCUSTCITYROW#
ID-1CCTY-11
ID-1C-1CTY-12
ID-2C-2CTY-21
ID-2C-3CTY-32
ID-4C-3CTY-41

 

The ROW# grows sequentially for the same ID and then restarts for each new ID as shown in the table above.

Thanks,

Labels (1)
1 Solution

Accepted Solutions
Highlighted
MVP
MVP

Try using second parameter in autonumber() like:

Autonumber(RowNo(), ID) as Increment

View solution in original post

4 Replies
Highlighted
Partner
Partner

Try Autonumber(ID)
Highlighted
Creator
Creator

thanks for the answer but this may not work for me.

it autogenerates the ID in a sequence but  I need to restart the number for a new ID the way I have shown in the second table.

 

Highlighted
MVP
MVP

Try using second parameter in autonumber() like:

Autonumber(RowNo(), ID) as Increment

View solution in original post

Highlighted
Digital Support
Digital Support

Just adding Help link to AutoNumber():

https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/Count...

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.