Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Declare variable works after binary load but not in original scipt

Can anyone tell me why the segment of script below works after I do a binary load of a report but not when I add it to the end of the script for that report andh ow to fix it? I'm just trying to get the max of dates in the data we load.

Temp:

LOAD max(Date) as tmpMaxDate

Resident table1;

LET vMaxVesselDate = floor(peek('tmpMaxDate'));

Drop Table Temp;

Tags (1)
4 Replies
Not applicable

Re: Declare variable works after binary load but not in original scipt

Variables dont get copied over to the new qvw when you do a binary load.

The variables need to be recreated in the final file.

Edit: A binary load copies only the data and the data-model. Nothing else gets copied over.

Not applicable

Re: Declare variable works after binary load but not in original scipt

That's not the problem I am having. The problem is that I CAN create the variable after loading my live report with a binary load and that script, but I CANNOT create the variable when I copy that segment of script to the end of the live report and reload it.

Edit: Actually I think I added the segment as a new tab in the script, rather than at the end of the current tab, if that makes a difference.

Not applicable

Re: Declare variable works after binary load but not in original scipt

Sorry I am not able to fully understand the issue at hand. Please bear with me here. Lets say you have qvw1 and qvw2.

qvw1 > binary load > qvw2.  So qvw2 is a result of the binary load. Now you are tying to create a variable in which qvw?

Also creating in a different tab shouldn't make any difference.

BTW, are you getting any error message or the variable doesn't exist or has blank value after reload of qvw2 ? Which one of these are you facing.

Thanks

jaimeaguilar
Valued Contributor II

Re: Declare variable works after binary load but not in original scipt

Hi,

Can you pleas post the error that the script is displaying?

regards