Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Tanviseth26
Contributor
Contributor

Qlik Sense Scripting -Failure on Peek() function while loading from .qvs file.

We have come across a strange error during the development. 

Our code was working when we ran the load script from a section on the .qvf file. But the same code fails when we tried deploying it as a .qvs file on Qlik Sense file server.

All that we have done was, we included another peek function to our old code to fetch the previous days details and Qlik throws the following error when we run it from a .qvs file.

Attaching the screenshot of the error from log file:

Tanviseth26_0-1606229441785.png

Note: same code runs successfully when we run the script directly in qvf file, but it is failing (on Peek function) only when we call the same code from .qvs file (used $(Must_Include... function to call the .qvs file). 

we have done the script and syntax check, still unable to rectify the error.

Please find below the newly added code sample where it throws the error:

If(ABC=Peek('Barcode') and XYZ <>'Temporarily Unknown',XYZ,
If(ABC=Peek('Barcode') and XYZ='Temporarily Unknown', Peek('XYZ'),
If(ABC<>Peek('Barcode') and XYZ='Temporarily Unknown','Green',XYZ))) as Field

we attempted the following options to fix the problem:

1) Compared the code for both the qvs files and qvf Script with text comparison tools and couldn't find any difference in the code.

2) Done the Syntax check on the new expression added on Peek function

3) Created a new qvs file for testing to ensure that the .qvs file is not corrupt.

4) Tried using Previous() Function instead of Peek()

It would be great if someone can help us on this.....

Labels (3)
1 Reply
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Compare the script execution log for the one that works against the one that fails. If you can't see the problem please post the failing script execution log.

-Rob