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: 
chrisbrain
Partner - Specialist II
Partner - Specialist II

Strange behaviour with for loop and peek?

This is confusing me! I have a table which I can correctly peek at values in using the following:

let y = peek('page', 0, FacebookProConnector_Page);    // y = "value1'

let y = peek('page', 1, FacebookProConnector_Page);    // y = "value2'   

let y = peek('page', 2, FacebookProConnector_Page);    // y = "value3'   

However, in a for loop, e.g.:

let noRows = NoOfRows('Table1');

for i=0 to $(noRows) // loop through every row

     let y = peek('page', $(i), Table1);

     // Additional load statement to other table here

next

I get weird behaviour.

- in the first iteration (i=0), y is correctly 'value1'

- In the second iteration (i=1), y = NULL ?????

But this only happens if I have the additional load statement (where the comment is above) present. If I remove the inner load to another table (and just have an empty loop) it seems to work ok.

I can't see what I could be doing wrong - would appreciate any ideas.

This is happening QlikView 9 desktop.

beeido.com - BI | Software | Qlik Integration Services
GitFirst - A CI/CD solution for Qlik Sense
10 Replies
rbecher
MVP
MVP

Hi Rob,

interesting approach! But, that means Tablename is a string and not a "table label without the ending colon" as doc says.

- Ralf

Astrato.io Head of R&D