Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi - not sure if anyone has a similar problem but any help would be greatly appreciated.
I've developed a qv file that pulls information from both a database and an MS Excel file. The database changes all the time while the Excel file only changes on a monthly basis. I have two remote users currently using this qv file, and since we do not use server or publisher I just send them copies of the file. The problem is that I have to send them the entire Excel file and recreate the directory structure on their client pc's to match my own environment so that the reload will work.
I would like to know if there is a way to only perform a reload on the database script and not run the Excel script and keep that part of the info intact. My thought is that I would reload the "monthly" data before I send them the qv file, and they in turn would only load the database data on a daily basis.
I'm not sure if this is where a Partial Reload would be used? From what I've read it doesn't look like this would solve the issue.
Thanks,
Simon
Hello Simon,
If Partial Reload is not a solution, why don't you create a variable at the beginning of the script, and depending on the value of that variable you load ona part or the whole script?
SET vMonthly = 0; Database: // This table will reload everytimeLOAD *;SQL SELECT * FROM Database; If ($(vMonthly) = 1) Then Excel: // This one only when you set variable to 1 LOAD * FROM Excelfile.xls;End If
I think of partial reload when I want to keep some information already loaded but add or replace some new records to the datamodel. Anyway, I do think that partial reload is a solution, since this is exactly what you want to achieve.
Database: // This table will reload everytime pulling all records from database, replacing the existing recordsREPLACE LOAD *;SQL SELECT * FROM Database; If (Not IsPartialReload()) Then Excel: // This one only when you do a complete reload LOAD * FROM Excelfile.xls;End If
Regards.
Hello Simon,
If Partial Reload is not a solution, why don't you create a variable at the beginning of the script, and depending on the value of that variable you load ona part or the whole script?
SET vMonthly = 0; Database: // This table will reload everytimeLOAD *;SQL SELECT * FROM Database; If ($(vMonthly) = 1) Then Excel: // This one only when you set variable to 1 LOAD * FROM Excelfile.xls;End If
I think of partial reload when I want to keep some information already loaded but add or replace some new records to the datamodel. Anyway, I do think that partial reload is a solution, since this is exactly what you want to achieve.
Database: // This table will reload everytime pulling all records from database, replacing the existing recordsREPLACE LOAD *;SQL SELECT * FROM Database; If (Not IsPartialReload()) Then Excel: // This one only when you do a complete reload LOAD * FROM Excelfile.xls;End If
Regards.
Thanks very much Miguel! I used the partial reload as per your instructions and it works perfectly. Thanks again!
Simon
Hi,
Miguel, For my understanding,
Solution 1 can't be correct, as if v_Monthly is set to 0; the Excel file won't be loaded during the next reload, so the table Excel won't exist at all (it will be removed). Correct me if I am wrong.
Solution 2: Your statement "If (Not IsPartialReload()) Then" is optional, as PartialReload only execute treatment which are preceded by Add or Replace. As you don't use any of those keyword for the loading of the Excel file, the treatment (Excel loading) will never be executed (during a PartialReload).
However the solution to add "Replace" in front of the DB Loading is the correct solution.
Simon,
But on top of that, you need to make sure that the user uses the PartialReload. If they do the mistake to use a Normal Reload, that is it; the data from Excel is gone.
Solution 2a:
I would suggest to create a shortcut for the user with the /p parameter so it launch the partial reload at the opening of the file and the user does not need to bother with the partial reload vs reload.
http://qlikviewmaven.blogspot.com/2008/08/qlikview-command-line-and-automation.html
Solution 2b:
Another solution is to place the "Replace" statement before the loading of the Excel file. So you are the one doing partial reload and not your user. When your user will perform normal reload, all statement preceded by 'Add' or 'Replace' will be disregarded
Solution 3:
Last solution (not related to QV) would be to used a single Excel file, stored under a shared folder (that you user have access), so the path encoded in QV would be unchanged and your user would be able to perform normal reload for all sources
Hello Nicolas,
Solution 1 means to change the variable manually. It's just an option.
Solution 2 uses QlikView IsPartialReload() so the user has control on what is being loaded in a partial reload. Yes, a partial reload will only load when preceding by ADD or REPLACE, but a normal reload will do load when ADD or REPLACE as well (but without actually adding or replacing), so there is a piece of code that will only be loaded (the excel) when the partial reload is done.
Regards.
Hi Miguel.
Really enjoy your answers on various topic! Thanks
I am new on QV, and yesterday I was studying the Partial Reload Documentation; You are right; I forgot that you need to specify the keyword "only" in order that it gets executed only during PartialReload.
My solution would be this one:
<pre>LOAD *;
SQL SELECT * FROM Database;
Replace only LOAD *
FROM Excelfile.xls;
Hello,
have anybody an exampel qvw of this script above??
I am new and would like understand partial reload.
By this script, it is possible to partiel reload one qvw on a QlikView Server with task reloading too???
Thanks