Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have a batch file which loads a qvw, which queries a DB and concatenates the result to a QVD every hour, and then replaces the original QVD. This works fine most of the time, but occasionally (every few weeks), the task drops data and concatenates the latest load with the QVD as it looked 1 month ago, which means data from 1 month ago to today is missing from the full QVD.
So for example, today (11 Feb 8 am) the batch file ran and concatenated the result with the QVD but from 11 Jan, instead of 11 Feb 7am - so now the date field sequence on the QVD is 11 Jan, 11 Feb, and the dates in between are missing.
Note that this task has been running since 2014 and so it's grown to over 400MB. Could this be why?
Hi,
I think this will take a little trouble shooting the find the problem. You noticed anything that could connect the the times when the load has not completed incorrectly? I,.e. times,dates, week day?
If i was troubleshooting this i would probably start, by keeping the query data as well a the full snap shot, This way we can look at the query qvd, when the issue occurs and see why it isn't concatenating with the full qvd data.
Mark
Hi Sifat,
Sorry my replies are coming in an unusual order, but all my posts are being moderated.
So, a couple of things here.
It doesn't actually sound as if you are doing a 'concatenate' as understood in Qlik terms, it sounds as if you are doing a flush and reload, ie, getting all records from the DB and replacing your QVD with the new records. If that is the case, then my strong suspicion would be that the issue is with the SQL code that is being run to pull back the view.
Hope that helps
George
As an aside for each reload run you could create a seperate QVD with its name suffixed by reload DateTime and not do the concatenate.
Then in your dashboard qvw do a wildcard QVD load or load them using a loop.
This will make your reload a load quicker re the QVD Load & Store, and could well make your diagnostics of whatever the underlying issue is easier.
Are you sure this is your actual script? Or did you translate/modify some parts into pseudo-code before you posted it in this thread?
If not, here are some minor items you may want to reflect upon:
Best,
Peter
gsbeaton To give context, the DB table is a constantly refreshing table of users logged in at at any point in time. If a user logs out, the user is dropped from the table. So when I take snapshots, I query the entire table, and I get a view of who was logged in at that hour. By concatenating these snapshots with each other, I get a growing QVD of users logged in each hour, 24 hours a day. Note that I'm running this as a service from Windows Task Scheduler via a batch file reload. Also, I'm not using ReloadTime(), I'm actually using let ReloadTime = now();
The tagged snapshots are being concatenated with each other into 1 large QVD file. That 1 large QVD file is LoginPoll.qvd that you see in the pseudo-script:
let ReloadTime = now();
If qvdcreatetime('QVDs\LoginPoll.qvd') Then
USLogin:
LOAD
*
FROM [QVDs\LoginPoll.qvd] (qvd);
else
USLogin:
Load
*,
'$(ReloadTime)' as ReloadTime
from DB;
end if
Concatenate(USLogin)
USLogin:
Load
*,
'$(ReloadTime)' as ReloadTime
from DB;
store [USLogin] as into [QVDs\LoginPoll.qvd] (qvd);
Do you have a better alternative to tagging the time? As the table doesn't actually have a timestamp field. Is there a better alternative to let ReloadTime = now(); ?
I think that might be the issue.
Default timer mode for now() should 1, i.e. function call. But you can make it explicite to be sure:
Let ReloadTime = Now(1);
I think you are nearly there. Your pseudo code infers a couple of logic issues, but it may be ok. Just to be clear though, here are the steps that I think you should be taking:
Another approach would be to use Qlik's wildcard feature to load all the snapshots in the folder, then delete or move them once successfully loaded. Both can be done from within QlikView. There's would be a lot less to go wrong with that approach.
Hope that helps
George
Thanks - I'll give this a go.