Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
datanibbler
Champion
Champion

Partial reload - leads to script_errors being reported? Plz help.

Hi,

in the script I'm currently working on, a specific table is being generated to report certain items.

Due to a process error, however, there can be wrong items in this table - so I want to offer the user a possibility to check those items.

To do that, the script has to be reloaded - but as this table has not been stored as a qvd, I would have to keep this table

=> A partial reload looks like just the thing I need. I have done some work with that feature and I have taken some notes - the "negative query" >>NOT(ISPARTIALRELOAD())<< has to come first, right?

So I have a code >> IF NOT(ISPARTIALRELOAD()) THEN <<, followed by everything I have in the script for standard situations. After all that is finished, just before the EXIT, I have implemented the second branch with an >> IF ISPARTIALRELOAD()) THEN << - but when I try this and partially reload the script, QlikView reports errors with one of the LOOPs in the course of the regular script_branch ...

Can anyone lend me a hand here?

Thanks a lot!

Best regards,

DataNibbler

1 Solution

Accepted Solutions
14 Replies
datanibbler
Champion
Champion
Author

Hi,

I have a better idea: There is this one big table that I need to consult several times in the script - that is prepared at the very outset of the script to make the following LOADs faster (only RESIDENT) - but the primary loading of the table still takes time. Now, if the users of this report check one item using the report, and within 2min they use it again, that is not really necessary - that big table itself is only renewed once an hour by another script.

The partial reload, however, is not explained in detail in any of my ebooks nor is it in the manual, and I haven't really worked with it yet. Can someone please help me with that?

I already have the script finished, quite complex, with several subroutines. As I understand it, when a partial reload is done, the tables that don't have a prefix are not touched - so I want to kind of build that around my existing script - all the tables except that big one should be replaced - but how do I place the ISPARTIALRELOAD() query?

Thanks a lot!

Best regards,

DataNibbler

tresesco
MVP
MVP

I guess I could not follow you entirely. If you use 'Replace load' for all the rest tables (except the big one), it should work, right? Am I missing something?

datanibbler
Champion
Champion
Author

Hi Tresesco,

no - it should work then, right - but where do I place the query to get it right? That's the detail that I could not find anywhere. Do I place this query in front of every table, around the keyword? That looks easier to me, easier than placing this as one giant bracket around the entire script ...

tresesco
MVP
MVP

Partial reload is only relevant to Load and Select statement, hence you have to place the keyword 'Replace' before every desired load/select statement.

datanibbler
Champion
Champion
Author

Yep, I know - we're still not meeting 😉

Best, I will post a sample here - a very simple one. My script is complex, but the logic should be the same ...

>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<

Temp1:

LOAD 1 as ONE, 2 as TWO, 3 as THREE autogenerate 1; // This table should be loaded only in a full reload;

// In a partial reload, it should just be left where it is

Temp2:

LOAD 'a' as letter1, 'b' as letter2, 'c' as letter3 autogenerate 1; // This table should be loaded in both a full and a partial

// reload.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

In this small example, where would I place the ISPARTIALRELOAD() query? I don't want to write the whole stuff a second time in my script

tresesco
MVP
MVP

I guess you just need a Replace/Add keyword before second reload like:

Temp2:

Replace LOAD 'a' as letter1, 'b' as letter2, 'c' as letter3 autogenerate 1;

IsPartialreload() is not required here.

datanibbler
Champion
Champion
Author

Ah, I see.

I'm working on Wifi right now, so i cannot try it out - that would be too much for our network ...

So that keyword would be ignored in a regular (full) load, right?

So I usually don't need this ISPARTIALRELOAD() - what then would I need that for?

Thanks a lot!

Best regards,

DataNibbler

P.S.: [5min later] - needless to say, that works fine - so in my big script where I actually want to use this, I can just put the REPLACE keyword in front of every table except that big one. Wonderful!

tresesco
MVP
MVP

As I mentioned, Partial reload would only execute statements Load/Select preceded by Add/Replace. If you come across a situation when you need to control other statements (apart from load/select) based on reload type (full/partial), something like:

if IsPartialreload() then

      let vVar=1;

  else

      let vVar=2;

endif

datanibbler
Champion
Champion
Author

Yes, I thought of something like that - I do have several variables and stuff in the script - but these should be executed in both reload-types, full and partial - so I don't have to do anything to them, do I?