Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
jduenyas
Specialist
Specialist

Misbehaving Peek() Function

Hello all

I found an oddity with the Peek function and hope there is a solution to it.

I have 2 Load statements for TABL1 and TABL2, preceded by a Qualify *; and Unqualify ID;

At the end of the data load I have a statement:

Let vPeek = Peek('ID',7,TABL1) so that I can see what is in the 8th record

(At this stage I know what will be there because the data I load is an INLINE load of sample data)

When viewing the value in variable vPeek it contains the data from TABL2 (second table to be loaded)

If I remove the Qualify and Unqualify statements the variable value is as I expect it to be from TABL1

Any idea?

Thanks

1 Solution

Accepted Solutions
simenkg
Specialist
Specialist

Let vPeek = Peek('ID',7,'TABL1')



QlikView documentation claims the syntax is as you have written, but in fact you have to use quotes around the table name.


The default behavior of Peek is to read from the last loaded table. When you do not use quotes around the table name it will try to evaluate the field TABL1 and that will return Null(). It will then try to read the field ID from the last loaded table, namely TABL2.


Hope that clears it up for you

Regards

SKG


View solution in original post

2 Replies
simenkg
Specialist
Specialist

Let vPeek = Peek('ID',7,'TABL1')



QlikView documentation claims the syntax is as you have written, but in fact you have to use quotes around the table name.


The default behavior of Peek is to read from the last loaded table. When you do not use quotes around the table name it will try to evaluate the field TABL1 and that will return Null(). It will then try to read the field ID from the last loaded table, namely TABL2.


Hope that clears it up for you

Regards

SKG


jduenyas
Specialist
Specialist
Author

Thanks a lot!

That indeed corrected the problem