Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello, all!
I am using a script (below) and I've noticed that the RowNo() function is not working properly when I am using a Preceding load.
I've added two rows' counts: RowNumPre and RowNumMain, placed in the Pre-load and the main load statements respectively.
Here are the results: the values in the main load part are not correct:
Every other function (FileName() in example above) are working fine.
An additional detail: I am loading the data from multiple files, so I am using a For each vFile in FileList() ... Next vFile loop....
Am I missing something?
Any comments/suggestions will be greatly appreciated.
Best regards,
Vladimir
Either use RecNo() in initial load or use RowNo() in the preceding load.... this is by design and have similar kind of structure as Peek and Previous
Sunny,
Thanks for suggestion! I forgot about RecNo() vs. RowNo() differences.
But using RecNo() is still not working fully in my case (when using For each vFile in FileList() ... Next vFile loop).
It counts Records in each file separately. Which might be useful actually, but I did not expect that.
Here is the same data load (from two separate files) with RecNo count restarting with each file.
Thanks for your suggestion, I will use it!
Regards,
Vlad
What is the problem with using RowNo() in the preceding load (your Row Num Pre)? That seems to be working, right?
RecNo() is a counter for input records. RowNo() is the counter for output records. As Sunny stated, RowNo() only works in the topmost LOAD of a preceding load.
RecNo() will be reset for each new file read. Since you are not filtering and rows or creating additional rows, RowNo() in your case is also valid as a running counter of input rows.
-Rob
Sunny, yes it's working, but not for the Total count. As rwunderlichhas mentioned below, the RecNo() counts Input records, so it resets the count for every new file in the loop. It should work identical with RowNo() count in case of "normal" preceding load.
Regards,
Vlad
Rob,
Thank you for clarification.
Vlad