<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Function peek does not work with a LOAD statement in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Function-peek-does-not-work-with-a-LOAD-statement/m-p/189499#M52371</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Pierre,&lt;/P&gt;&lt;P&gt;I've done a few changes to your script, and it works fine for me&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;ListTickets:LOAD * INLINE [TicketABC]; FOR a = 0 TO 2 LET teest = PEEK('Ticket', $(a), 'ListTickets'); // Fields are case sensitive, both field and table name must be quoted TableX: LOAD '$(teest)' as TicketTest // I use single quotes here, instead of using them as chr(39) in the variable above AUTOGENERATE (1); NEXT&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Hope this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Nov 2010 16:39:40 GMT</pubDate>
    <dc:creator>Miguel_Angel_Baeyens</dc:creator>
    <dc:date>2010-11-16T16:39:40Z</dc:date>
    <item>
      <title>Function peek does not work with a LOAD statement</title>
      <link>https://community.qlik.com/t5/QlikView/Function-peek-does-not-work-with-a-LOAD-statement/m-p/189498#M52370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a problem with peek function when using a load statement:&lt;/P&gt;&lt;P&gt;Let's say there is a table called '&lt;STRONG&gt;ListTickets&lt;/STRONG&gt;', with one field '&lt;STRONG&gt;Ticket&lt;/STRONG&gt;', and only three values : &lt;STRONG&gt;A, B,&lt;/STRONG&gt; and &lt;STRONG&gt;C&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I would like to use the peek function with each row one at a time, save the value in a variable, and use the variable in a load statement&lt;/P&gt;&lt;P&gt;My code is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;&lt;B&gt;&lt;BR /&gt;ListTickets:&lt;BR /&gt;&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;&lt;BR /&gt;Ticket&lt;BR /&gt;&lt;BR /&gt;A&lt;BR /&gt;&lt;BR /&gt;B&lt;BR /&gt;&lt;BR /&gt;C&lt;BR /&gt;&lt;BR /&gt;];&lt;BR /&gt;&lt;BR /&gt;for a=0 to 2&lt;BR /&gt;&lt;BR style="padding-left: 30px;" /&gt;let teest = chr(39) &amp;amp; peek('Ticket', $(a), ListTickets) &amp;amp; chr(39);&lt;BR /&gt;&lt;BR style="padding-left: 30px;" /&gt;TableX:&lt;BR /&gt;&lt;BR style="padding-left: 30px;" /&gt;load $(teest) as TicketTest&lt;BR /&gt;&lt;BR style="padding-left: 30px;" /&gt;AutoGenerate(1);&lt;BR /&gt;&lt;BR /&gt;next&lt;BR /&gt;&lt;BR /&gt;&lt;/B&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Unfortunately, I do not understand the behaviour of the script&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;On the first loop (when a=0), 'teest' gets the value A (as expected), and the load statement works great.&lt;/LI&gt;&lt;LI&gt;On the second and third loop (when a=1 or a=2), 'teest' gets the value NULL (I expect values B and C)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I write :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P style="PADDING-LEFT: 30px"&gt;let &lt;B&gt;&lt;I&gt;teest&lt;/I&gt;&lt;/B&gt; = peek('Ticket',0, ListeTickets);&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P style="PADDING-LEFT: 30px"&gt;let &lt;B&gt;&lt;I&gt;teest&lt;/I&gt;&lt;/B&gt; = peek('Ticket',1, ListeTickets);&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P style="PADDING-LEFT: 30px"&gt;let &lt;B&gt;&lt;I&gt;teest&lt;/I&gt;&lt;/B&gt; = peek('Ticket',2, ListeTickets);&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;DIV style="margin-left: 2em"&gt;&lt;P&gt;before any LOAD statement, I have no problem, teest has the expected values (A, B, and C) [:)]&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;after the LOAD statement, teest has always NULL as value [:@]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you know what happens ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Nov 2010 16:24:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Function-peek-does-not-work-with-a-LOAD-statement/m-p/189498#M52370</guid>
      <dc:creator />
      <dc:date>2010-11-16T16:24:34Z</dc:date>
    </item>
    <item>
      <title>Function peek does not work with a LOAD statement</title>
      <link>https://community.qlik.com/t5/QlikView/Function-peek-does-not-work-with-a-LOAD-statement/m-p/189499#M52371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Pierre,&lt;/P&gt;&lt;P&gt;I've done a few changes to your script, and it works fine for me&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;ListTickets:LOAD * INLINE [TicketABC]; FOR a = 0 TO 2 LET teest = PEEK('Ticket', $(a), 'ListTickets'); // Fields are case sensitive, both field and table name must be quoted TableX: LOAD '$(teest)' as TicketTest // I use single quotes here, instead of using them as chr(39) in the variable above AUTOGENERATE (1); NEXT&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Hope this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Nov 2010 16:39:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Function-peek-does-not-work-with-a-LOAD-statement/m-p/189499#M52371</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2010-11-16T16:39:40Z</dc:date>
    </item>
    <item>
      <title>Function peek does not work with a LOAD statement</title>
      <link>https://community.qlik.com/t5/QlikView/Function-peek-does-not-work-with-a-LOAD-statement/m-p/189500#M52372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Miguel&lt;/P&gt;&lt;P&gt;Thanks a lot for your help !&lt;/P&gt;&lt;P&gt;It seems the problem is coming from the quotes that I forgot when specifying the table name in the peek function.&lt;/P&gt;&lt;P&gt;In QV help, it is explained that the table name should &lt;STRONG&gt;not&lt;/STRONG&gt; be between quotes, and clearly it works &lt;STRONG&gt;with&lt;/STRONG&gt; quotes...&lt;/P&gt;&lt;P&gt;Thanks again &lt;IMG alt="Smile" src="http://community.qlik.com/emoticons/emotion-1.gif" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Nov 2010 16:59:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Function-peek-does-not-work-with-a-LOAD-statement/m-p/189500#M52372</guid>
      <dc:creator />
      <dc:date>2010-11-16T16:59:52Z</dc:date>
    </item>
    <item>
      <title>Function peek does not work with a LOAD statement</title>
      <link>https://community.qlik.com/t5/QlikView/Function-peek-does-not-work-with-a-LOAD-statement/m-p/189501#M52373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pierre (Miguel),&lt;/P&gt;&lt;P&gt;this is absolutly correct. In the help it looks quite the other way as it is in reality. Don't bother, this is a trap I felt in about 10...... times &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Regards, Roland&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Nov 2010 17:06:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Function-peek-does-not-work-with-a-LOAD-statement/m-p/189501#M52373</guid>
      <dc:creator />
      <dc:date>2010-11-16T17:06:36Z</dc:date>
    </item>
  </channel>
</rss>

