Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi.
I have an app with several tables inside of it.
t1:
Load *
From t1.qvd;
t2:
Load *
From t2.qvd;
...
t22:
Load *
From t222.qvd;
I need to create new table inside the app that will contain the liast of the all tables name ans timestamps what each of these tables was start loading and finished. I tried to so it via the script below, but I getting only one and the same timestamp for all tables. What am I doing wrong?
t1:
Load *
From t1.qvd;
t2:
Load *
From t2.qvd;
...
t22:
Load *
From t222.qvd;
For t = 0 to NoOfTables() - 1
Tables:
Load
Now() as ReloadStart,
$(t) as id,
TableName($(t)) as Table,
TableNumber(TableName($(t))) + 1 as TableNo,
NoOfRows(TableName($(t))) as TableRows,
Now() as ReloadEnd
Autogenerate 1;
Next t;
The problem is I am not developer, but what has to be happening is the values being placed into your alias fieldnames are being overwritten on each loop, only explanation, but I am not sure why given the autogenerate etc. The only thing of which I can think to do is use the Script Editor Debugger to step through things live, so you can see exactly what is going on that way, maybe that will help you see what is going wrong at that point, but from what I know things look correct. Maybe someone else will have a look now that I am posting and be able to come up with something better for you.
Regards,
Brett
Hi,
You can try using FileTime function to extract the generated time of File.
Thanks,
Amay
Are you wanting to record the timestamp that each of the tables started loading and finished loading? That's how I interpreted your question, let me know if I have this wrong 🙂
If I've understood your requirement correctly, what you've got in your script certainly won't work. I suspect the timestamp you are generating is the same because it is literally executing in an instant, or close enough that the Qlik engine can't tell the difference. All that script is doing effectively is iterating through some system metadata that it has in memory, so it is extremely quick. To test this you could inject a pause by using the "sleep" command to introduce a time lag.
If instead you are looking to log load start and end times I suggest creating two variables and putting them into a table as you go. Here's an example from where this question was answered previously: https://community.qlik.com/t5/QlikView-App-Development/Script-start-time-and-end-time/m-p/920307
Hope that helps,
Rod