Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted

RecNo vs. RowNo

Instead of flooding an existing post, I thought it would make sense to start a new one. Here is a sample script with RecNo() and RowNo() in Preceding Load and Resident Load giving different outputs.

Table:

LOAD RecNo,

  RowNo;

LOAD RecNo() as RecNo,

  RowNo() as RowNo

AutoGenerate 10;

Table2:

LOAD RecNo() as RecNo2,

  RowNo() as RowNo2

AutoGenerate 10;

Table3:

NoConcatenate

LOAD RecNo2,

  RowNo2

Resident Table2;

DROP Table Table2;

Output:

Capture.PNG

My confusion is -> Why does RowNo() doesn't work in the preceding load when it does work in Resident Load.

swuehlMRKachhiaIMP

Best,

Sunny

4 Replies
MVP
MVP

Re: RecNo vs. RowNo

MVP
MVP

Re: RecNo vs. RowNo

Source : Mastering QlikView Book

This is because the RowNo() function only returns correctly in the top loader of a preceding load. It must be like this because each preceding load can have its own Where clause that can modify the number of rows loaded. Only at the topmost load do we actually know that a row is loaded.

Table1:

Load

  *,

  RowNo1 as RowNo2,

  RowNo() As RowNo3;

Load

  *,

  RowNo() As RowNo1

Inline

[

  Field1

  A

  B

  C

  D

];

So, here only the topmost load will have RowNo(), so only RowNo3 will give you expected result..

Re: RecNo vs. RowNo

But my confusion is that why does it work in a Resident Load and not in Preceding Load. Isn't Preceding Load and Resident Load mostly similar? Why will it work in one and not in the other?

MVP
MVP

Re: RecNo vs. RowNo

No it's different.

Please read answer of Jose Maria from the link provided by stefen...

In Resident Load the 2nd table is loaded only after the first table fully loaded.

In Preceding Load the 1st Table's 1st line loaded which is now being used by Preceding Load before the 1st table's 2nd line getting load.

Hope this would make your doubt clear.