I use an incremental load to load 3 reports into qlikview. I have written my code so that a table is created with the reports from the latest date for which all reports are available. The table looks like this (in order of loading):
file report category
In my script I write the following code:
I would think this code gives me the filename of the file that I want to load, but apparently every vReport leads to the same result; it always results in filename3, even though the fieldindex formula returns a different number. What am I doing wrong here?
Thanks in advance for your help.
What do the fieldindex() functions return as value for each call?
And what does this return as variables value:
Does your Table1 only holds three records or duplicate records per file?
fieldindex('rapport,'Category1') yields value 1
fieldindex('rapport,'Category2') yields value 2
fieldindex('rapport,'Category3') yields value 3
Table1 only has the 2 fields that I described, filename and category
Please note that I loaded category as right(filename, 6), since the last bit of the filename describes to which category it belongs.
When I load table1 and create a table object, I see no duplicate values. Just the 3 file names and their respective categories.
vReport1=peek('file'0,'table1) also yields filename3. No matter which number I use as a row number in the peek function, it returns the same filename. Even when I use 10, even though there are only supposed to be 3 rows in my table.
The table box won't show duplicate records. If you open table view CTRL-T, and open preview of that table 1, only 3 distinct records are shown?
I assume you are creating duplicate records in your table 1 creation.
Also note the different indexing start value for peek( zero) vs fieldindex( one ).