Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

where to write recno()

Hi, which part of the script do I place the recno() function? I just want to count the number of duplicate rows and display in a table. Thanks.

4 Replies
jagan
Luminary Alumni
Luminary Alumni

Hi,

RecNo() is used in script like this

LOAD

*,

RecNo() AS RecordNumber

FROM DataSource;

Regards,

jagan.

Not applicable
Author

Oh thank you, I've tried that, but how do I determine the number of duplicate rows each record has? I have many records that have many duplicates and also records that only appear once, and I want to create another column that displays the number of duplicate rows for each record. Thanks.

jagan
Luminary Alumni
Luminary Alumni

HI,

Attach some sample data and list some duplicate rows, so that it would be easier to give solution.

REgards,

Jagan.

its_anandrjs

Hi,

You can use this simple example in your script for count the duplicate records and tag the duplicate records rows also see the script

Source:

LOAD * Inline

[

ID

A

A

A

B

C

C

C

D

D

D

E

];

CountTable:

LOAD

ID,

Count(ID) as Count

Resident Source

Group By ID;

InfoTable:

LOAD

ID,

Count,

If(Count > 1,'Duplicate Records','No Duplicates') as Details

Resident CountTable;

DROP Table CountTable;