Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Not applicable

Partial Reload: REPLACE/ADD LOAD returns script errors before loading

Dear all,

I insert a ADD (Replace) load (I tried both ways, same outcome) at the end of my big script, in a separate tab.

When I press "partial reload", I get some warnings of Script Errors.

Namely:

Field not found in the DROP FIELD statement (3 times)

Table not found in a LEFT JOIN (1 time).

After this, the lines of the "additional table" are loaded perfectly.

It seems like that the command partial reload reads through commands like JOIN and DROP FIELD, instead of skipping them.

This is a problem for me, as I want to schedule the partial reload and it means "someone" needs to click on "OK" in order for these errors to be skipped.

Why am I gettign these erros, any idea?

How can I solve this? This is the last challenge I need to overcome before handing in my final Beta!

Many many thanks!

1 Solution

Accepted Solutions
Highlighted

Re: Partial Reload: REPLACE/ADD LOAD returns script errors before loading

Hi,

Yes, you are correct: you can place the IF ... THEN say in the first tab on the left, then place the END IF in the last tab on the right, just before the ADD/REPLACE loads, so when you do a partial reload, only the ADD/REPLACE loads take place.

Note that, despite the tabs, the script is always run from the first line on the tab most on the left to the last line on the tab most to the right, it is actually just a visual aid, rather than an actual division. If you Debug the script instead of running it, you will see how each line runs after the other, irrespective the tabs they are on.

One way to make some tabs (pieces of code) be loaded or not is using this IF THEN END IF conditionals.

This IF will actually save you script running time, as it is avoiding the execution of lines of script that, otherwise, should be run and causing errors.

Hope that helps.

Miguel

P.S.: It's worth noting that ADD and REPLACE loads are executed in both normal and partial reloads, unless you use the ONLY qualifier, to make the ADD or REPLACE take place only if a partial reload has been executed. So

Customers:

REPLACE LOAD *

FROM Customers.qvd (qvd);

Will work always, removing the table Customers and replacing it by the records in the QVD file, whilst

Customers:

REPLACE ONLY LOAD *

FROM Customers.qvd (qvd);

Will only be loaded if the execution was partial, but not when the reload is normal.

Hope that makes the thing easier to understand.

View solution in original post

5 Replies

Re: Partial Reload: REPLACE/ADD LOAD returns script errors before loading

Hi,

When executing a partial script reload, all lines are executed except for LOAD and SELECT not preceded by ADD o REPLACE. So the DROP error is likely happening because there is no actual table/field to drop, probably because it is referring to a previous LOAD that has not happened, because of the partial reload.

And similar to the JOIN, that tries to JOIN to a table that has not been loaded, therefore the error.

I'd recommend you to wrap the code you want to run only in normal reloads using

IF IsPartialReload() = 0 THEN

...

END IF

Hope that helps.

Miguel

Not applicable

Re: Partial Reload: REPLACE/ADD LOAD returns script errors before loading

When executing a partial script reload, all lines are executed except for LOAD and SELECT not preceded by ADD o REPLACE.

I was naive, and thinking that a Partial Reload is executing just lines preceded by ADD LOAD or REPLACE LOAD!

Good to know this!

So the DROP error is likely happening because there is no actual table/field to drop, probably because it is referring to a previous LOAD that has not happened, because of the partial reload.

And similar to the JOIN, that tries to JOIN to a table that has not been loaded, therefore the error.

The error is definitely happening because of this!

I'd recommend you to wrap the code you want to run only in normal reloads using

IF IsPartialReload() = 0 THEN

...

END IF

Hope that helps.

Miguel

If I understood you correctly, I can write the IF statement at the very beginning of my whole script, and then, after the last line (but before the partial reload) I can write the END IF statement.

And not writing the two statements before/after the DROP FIELD or JOIN, right?

I will let you know the, hopefully positive, outcome!

Is this IF causing additional resources need / processing time, or is it completely harmless?

Thank you very much!

Highlighted

Re: Partial Reload: REPLACE/ADD LOAD returns script errors before loading

Hi,

Yes, you are correct: you can place the IF ... THEN say in the first tab on the left, then place the END IF in the last tab on the right, just before the ADD/REPLACE loads, so when you do a partial reload, only the ADD/REPLACE loads take place.

Note that, despite the tabs, the script is always run from the first line on the tab most on the left to the last line on the tab most to the right, it is actually just a visual aid, rather than an actual division. If you Debug the script instead of running it, you will see how each line runs after the other, irrespective the tabs they are on.

One way to make some tabs (pieces of code) be loaded or not is using this IF THEN END IF conditionals.

This IF will actually save you script running time, as it is avoiding the execution of lines of script that, otherwise, should be run and causing errors.

Hope that helps.

Miguel

P.S.: It's worth noting that ADD and REPLACE loads are executed in both normal and partial reloads, unless you use the ONLY qualifier, to make the ADD or REPLACE take place only if a partial reload has been executed. So

Customers:

REPLACE LOAD *

FROM Customers.qvd (qvd);

Will work always, removing the table Customers and replacing it by the records in the QVD file, whilst

Customers:

REPLACE ONLY LOAD *

FROM Customers.qvd (qvd);

Will only be loaded if the execution was partial, but not when the reload is normal.

Hope that makes the thing easier to understand.

View solution in original post

Luminary
Luminary

Re: Partial Reload: REPLACE/ADD LOAD returns script errors before loading

Hi,

I've also made a video tutorial on how to use Partial Reload.

http://qlikshare.com/370

Happy learning!

Cheers,

DV

Not applicable

Re: Partial Reload: REPLACE/ADD LOAD returns script errors before loading

P.S.: It's worth noting that ADD and REPLACE loads are executed in both normal and partial reloads, unless you use the ONLY qualifier, to make the ADD or REPLACE take place only if a partial reload has been executed. So

Customers:

REPLACE LOAD *

FROM Customers.qvd (qvd);

Will work always, removing the table Customers and replacing it by the records in the QVD file, whilst

Customers:

REPLACE ONLY LOAD *

FROM Customers.qvd (qvd);

Will only be loaded if the execution was partial, but not when the reload is normal.

Hope that makes the thing easier to understand.

Dear Miguel,

thank you very much for your help, it is working perfectly.

Indeed this last remark of your is very valuable, thank you really very much!