Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

record counter

Using record counter on keyfields in qlikview..can anyone explain me with example.

1 Reply
rahulpawarb
Specialist III
Specialist III

Hello Sindhu,

Trust you are doing good!

RecNo() is a script function. This script functions returns an integer for the number of the currently read row of the current table. The first record is number 1.

Below is syntax:

RecNo() As RecordNo

In contrast to RowNo() function (It is a function which counts rows in the resulting QlikView table), RecNo(), counts the records in the raw data table and is reset when a raw data table is concatenated to another.

Example: Load script

Raw data table load:

Tab1:

LOAD * INLINE

[A, B

1, aa

2,cc

3,ee];

Tab2:

LOAD * INLINE

[C, D

5, xx

4,yy

6,zz];

Loading record and row numbers for selected rows:

QTab:

LOAD *,

RecNo( ),

RowNo( )

resident Tab1 where A<>2;

LOAD

C as A,

D as B,

RecNo( ),

RowNo( )

resident Tab2 where A<>5;

//We don't need the source tables anymore, so we drop them

Drop tables Tab1, Tab2;

The resulting QlikView internal table:

Result.PNG

Reference:

http://help.qlik.com/en-US/qlikview/12.1/Subsystems/Client/Content/Scripting/CounterFunctions/RecNo....

Hope this will help.

Regards!

Rahul