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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Majed84
Contributor II
Contributor II

Counter for Duplicate duplicate values

Hi everyone,

I've tried to create a counter in script or dashboard but no luck, let say the column "counter" result counts according to ID, Name and Status values.

ID, Name, Status, Counter

1DD,  Sam, Active, 1 

1DD,  John, Active, 1 

1DD,  Sam, Active, 2 

3AA, Sam, Active, 1 

3AA, Sam, Active, 2 

3AA, Sam, Fail, 1 

4GG, Sam, Fail, 1 

4GG, Sam, Fail, 2

4GG, Sam, Active, 1

4GG, John, Fail, 1

4GG, Sam, Fail, 3

4GG, Sam, Active, 2

4GG, John, Fail, 2

4GG, Sam, Fail, 4

 

Thank you!

 

 

Labels (5)
1 Solution

Accepted Solutions
BrunPierre
Partner - Master II
Partner - Master II

Hi @Majed84, I believe this is what you're looking for.

autonumber(recno(),ID& Name& Status) as Counter

View solution in original post

6 Replies
henrikalmen
Specialist II
Specialist II

I don't understand what you want to do, could you please explain a bit more?

Anil_Babu_Samineni

@Majed84 Perhaps this way? This is Just assumption. //RowNo() to not remove the duplicate records. //Count1 is expected result.

 

LOAD *, RowNo() as RowNo, AutoNumber(ID1&Name&Status,IterNo()) as Counter1 Inline [
ID1, Name, Status, Counter

1DD, Sam, Active, 1

1DD, John, Active, 1

1DD, Sam, Active, 2

3AA, Sam, Active, 1

3AA, Sam, Active, 2

3AA, Sam, Fail, 1

4GG, Sam, Fail, 1

4GG, Sam, Fail, 2

4GG, Sam, Active, 1

4GG, John, Fail, 1

4GG, Sam, Fail, 3

4GG, Sam, Active, 2

4GG, John, Fail, 2

4GG, Sam, Fail, 4
];

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Majed84
Contributor II
Contributor II
Author

hi,

as the example showing, I need to create a counter start with 1 or 0 and count +1  whenever all three columns matched (ID, Name, Status)

BrunPierre
Partner - Master II
Partner - Master II

Hi @Majed84, I believe this is what you're looking for.

autonumber(recno(),ID& Name& Status) as Counter

henrikalmen
Specialist II
Specialist II

If your table in the example is called ExampleTable this may be what you want (but I still don't quite understand what result you expect, it would be nice if you could give an example of the desired outcome based on your example).

left join(ExampleTable) load ID, Name, Status, sum(1) as uniquecounter resident ExampleTable group by ID, Name, Status;

This would give you a new field in the table, and on each row you would have a counter of how many times in the table that the row's specific combination of ID, Name and Status occurs.

But on the other hand: that is probably not what you want. Maybe someone else that already answered has a better understanding of your needs.

Majed84
Contributor II
Contributor II
Author

Big thanks, this is what I need

Note: it takes time with a big data. but it's working fine.