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: 
yelin_nyu
Creator
Creator

autogenerate unique id for distinct values

I need to generate an ID for each customer from detail table. meaning there are multiple records per customer.

here is what I did

load distinct customer

rowno() as ID

from detail_table

order by customer;

rather than getting

customer  ID

Abbie       1

Bill            2

Cathy      3

I got this

customer  ID

Abbie       1

Abbie       2

Abbie       3

Abbie       4

Bill            5

Bill            6

Bill            7

Cathy      8

1 Solution

Accepted Solutions
rbecher
MVP
MVP

Just use autonumber(customer) as ID..

Astrato.io Head of R&D

View solution in original post

3 Replies
rbecher
MVP
MVP

Just use autonumber(customer) as ID..

Astrato.io Head of R&D
yelin_nyu
Creator
Creator
Author

This is great. is there a way to specify the order when auto generate the ID?

Not applicable

Customer_deatils:

LOAD * Inline [

customer,  ID

Abbie,       1

Abbie,       2

Abbie,       3

Abbie,       4

Bill,            5

Bill,            6

Bill,            7

Cathy,      8

];

LOAD customer,AutoNumber(ID) as uni_id Resident Customer_deatils