Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
datanibbler
Champion
Champion

Issue with PEEk

Hi guys,

I have an issue with a PEEK() function: I know how it works - I have to enclose the fieldname in quotes, then comes a counter and then the tablename

=> So when I have a table named >>Temp2<< and I want the field >>ID<< from the first record, I go like

      >> PEEK('ID', 0, Temp2) <<

I can also do that in a loop, I only have to use $(i) instead of that 0 (if i is my counter)

<=> That is the issue: That does not work and I cannot spot any typo or similar - in fact, I have just put an EXIT behind the creation of Temp2 and then copied the PEEK() function out of my loop and just replaced the $(i) with a hard-coded 0 - so the syntax must be exactly the same - but inside the loop, the PEEK() function does not return a value.

Can it be that there may not be a table inbetween?

The thing is, inbetween Temp2 and my loop, I create a small dummy_table which I can append to inside the loop - but that is just one record with all the fields from the original table, but every field empty. Can that be the reason for the issue?

Thanks a lot!

Best regards,

DataNibbler

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try adding single quotes around the table name as well: PEEK('ID', 0, 'Temp2')


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try adding single quotes around the table name as well: PEEK('ID', 0, 'Temp2')


talk is cheap, supply exceeds demand
datanibbler
Champion
Champion
Author

Yep! That works.

I was very sure - but I know sometimes you just have to try out different solutions.

Thank you!