Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
cancel
Showing results for 
Search instead for 
Did you mean: 
pranaview
Creator III
Creator III

how to assign an incremental ID for duplicate values

Hi Guys,

Requirement: So, I am looking for a way to uniquely identify a column which has duplicate values. There is no other unique ID column in the table which i can use to create a composite key. I was thinking if I can number the duplicate values then I can I have a unique ID.

for example, something like this:

ID                  AutoIncrementNo.    or    AutoIncrementNo.

12455                    -                                                      -       

12567                   1                                                      -

12567                   2                                                      1

12567                   3                                                      2

12768                    -                                                      -

12789                    1                                                     -

12789                    2                                                     -

 

I hope i have the requirement clear enough, please let me know if there's any way i can implement this.

Thanks!

Pranav

Labels (3)
1 Solution

Accepted Solutions
Arthur_Fong
Partner
Partner

Try this as your duplicate counts:

if(RowNo()=1,1,if(peek(ID)=ID,peek(Num1)+1,1)) as Num1

View solution in original post

2 Replies
Arthur_Fong
Partner
Partner

Try this as your duplicate counts:

if(RowNo()=1,1,if(peek(ID)=ID,peek(Num1)+1,1)) as Num1

View solution in original post

pranaview
Creator III
Creator III
Author

Thanks Arthur!

This is what I was looking for.