Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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.

Tags (3)
4 Replies
MVP
MVP

Re: where to write recno()

Hi,

RecNo() is used in script like this

LOAD

*,

RecNo() AS RecordNumber

FROM DataSource;

Regards,

jagan.

Not applicable

Re: where to write recno()

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.

MVP
MVP

Re: where to write recno()

HI,

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

REgards,

Jagan.

Re: where to write recno()

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;

Community Browser