Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

vlad_komarov
Valued Contributor III

RowNo function with Preceding load

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.

Screen Shot 2017-08-15 at 10.38.06 AM.png

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:

Screen Shot 2017-08-15 at 10.41.26 AM.png

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

6 Replies

Re: RowNo function with Preceding load

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

vlad_komarov
Valued Contributor III

Re: RowNo function with Preceding load

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.

Screen Shot 2017-08-15 at 2.01.24 PM.png

Thanks for your suggestion, I will use it!

Regards,

Vlad

Re: RowNo function with Preceding load

What is the problem with using RowNo() in the preceding load (your Row Num Pre)? That seems to be working, right?

Re: RowNo function with Preceding load

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

http://masterssummit.com

http://qlikviewcookbook.com

vlad_komarov
Valued Contributor III

Re: RowNo function with Preceding load

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

vlad_komarov
Valued Contributor III

Re: RowNo function with Preceding load

Rob,

Thank you for clarification.

Vlad

Community Browser