Discussion Board for collaboration on QlikView Scripting.
I am doing a developement of the script , where i want to generate a autonumber id for every row.
but the logic is for example...currently i have loaded 10 rows and the autonumber should be 1-10.
but tomorrow when i will load the new file the data should append and new rows should start from 11 and more.
current load ID should be autonumber.
when i will get data new data than our rows would like
please suggest ...how to append new rows with progressive autonumber ids.
Hope the attached solution solves your problem.
RecNo() as RecNo
[239502QC Thread 239502.xlsx]
(ooxml, embedded labels, table is Sheet1);
AutoNumber(RecNo&Name) as ID,
DROP Table Tbl1;
That is fine but what when i will do the incremental load.
let's assume we have 1--5 id generated with your load statement.
now i want to load new data but data should append from row 6 ---n with proper id ....
Autonumber will only work fine inside your script execution, next time you'll execute your script Qlikview will not have any clue of what value is behind autonumbered column.
Best option for that kind of case is using autonumberHash function that function wil generate a longer Hash sting based on value of original(s) column.
If you are looking for better performances I suggest to don't use it, the best option will be to store the original ID column every day and recalcul autonumber after adding increment data.
LET var.today = date(today(),'YYYY-MM-DD');
$(var.today) as Date,
STORE Tbl1 INTO tbl1_$(var.today).qvd (qvd);
AutoNumber(Date&RecNo&Name) as ID,
FROM tbl1_*.qvd (qvd);