Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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:
My confusion is -> Why does RowNo() doesn't work in the preceding load when it does work in Resident Load.
Best,
Sunny
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..
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?
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.