<?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 Re: Problem with peek() in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-with-peek/m-p/939472#M647034</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table1:&amp;nbsp; &lt;/P&gt;&lt;P&gt;LOAD * INLINE [&amp;nbsp; &lt;/P&gt;&lt;P&gt;Field1&amp;nbsp; &lt;/P&gt;&lt;P&gt;Aaa&amp;nbsp; &lt;/P&gt;&lt;P&gt;Bbb&amp;nbsp; &lt;/P&gt;&lt;P&gt;Ccc&amp;nbsp; &lt;/P&gt;&lt;P&gt;];&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;LET nbVal = FieldValueCount('Field1');&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Table2:&amp;nbsp; &lt;/P&gt;&lt;P&gt;LOAD * INLINE [&amp;nbsp; &lt;/P&gt;&lt;P&gt;Field2&amp;nbsp; &lt;/P&gt;&lt;P&gt;1&amp;nbsp; &lt;/P&gt;&lt;P&gt;2&amp;nbsp; &lt;/P&gt;&lt;P&gt;3&amp;nbsp; &lt;/P&gt;&lt;P&gt;];&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;FOR _i = 0 TO nbVal - 1&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; LET _val = peek('Field1', _i,'TableName');&amp;nbsp; &lt;STRONG&gt;//Give table name here when another table in between&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET _res = MsgBox('$(_val)');&amp;nbsp; &lt;/P&gt;&lt;P&gt;NEXT _i&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Oct 2015 14:08:52 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-10-08T14:08:52Z</dc:date>
    <item>
      <title>Problem with peek()</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-peek/m-p/939471#M647033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to loop on every value of a field, with the "peek" function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following code works:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14443129455297192 jive_text_macro" jivemacro_uid="_14443129455297192"&gt;
&lt;P&gt;Table1:&lt;/P&gt;
&lt;P&gt;LOAD * INLINE [&lt;/P&gt;
&lt;P&gt;Field1&lt;/P&gt;
&lt;P&gt;Aaa&lt;/P&gt;
&lt;P&gt;Bbb&lt;/P&gt;
&lt;P&gt;Ccc&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;LET nbVal = FieldValueCount('&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;Field1&lt;/SPAN&gt;');&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;FOR _i = 0 TO nbVal - 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp; LET _val = peek('&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;Field1&lt;/SPAN&gt;', _i);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; LET _res = MsgBox('$(_val)');&lt;/P&gt;
&lt;P&gt;NEXT _i&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will pop up "Aaa", "Bbb" and "Ccc".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if I load another table between the table and the loop, it doesn't work anymore:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14443130216215179 jive_text_macro" jivemacro_uid="_14443130216215179"&gt;
&lt;P&gt;Table1:&lt;/P&gt;
&lt;P&gt;LOAD * INLINE [&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;Field1&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Aaa&lt;/P&gt;
&lt;P&gt;Bbb&lt;/P&gt;
&lt;P&gt;Ccc&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;LET nbVal = FieldValueCount('&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;Field1&lt;/SPAN&gt;');&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Table2:&lt;/P&gt;
&lt;P&gt;LOAD * INLINE [&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;Field2&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;FOR _i = 0 TO nbVal - 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp; LET _val = peek('&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;Field1&lt;/SPAN&gt;', _i);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; LET _res = MsgBox('$(_val)');&lt;/P&gt;
&lt;P&gt;NEXT _i&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't understand why loading another table prevents the "peek()" to succeed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I'm adding the table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14443133462026120" jivemacro_uid="_14443133462026120"&gt;
&lt;P&gt;LET _val = peek('Field1', _i, 'Table1');&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does that means the function "peek" with 2 parameters is not reliable?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2015 14:07:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-peek/m-p/939471#M647033</guid>
      <dc:creator>nicolas_martin</dc:creator>
      <dc:date>2015-10-08T14:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with peek()</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-peek/m-p/939472#M647034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table1:&amp;nbsp; &lt;/P&gt;&lt;P&gt;LOAD * INLINE [&amp;nbsp; &lt;/P&gt;&lt;P&gt;Field1&amp;nbsp; &lt;/P&gt;&lt;P&gt;Aaa&amp;nbsp; &lt;/P&gt;&lt;P&gt;Bbb&amp;nbsp; &lt;/P&gt;&lt;P&gt;Ccc&amp;nbsp; &lt;/P&gt;&lt;P&gt;];&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;LET nbVal = FieldValueCount('Field1');&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Table2:&amp;nbsp; &lt;/P&gt;&lt;P&gt;LOAD * INLINE [&amp;nbsp; &lt;/P&gt;&lt;P&gt;Field2&amp;nbsp; &lt;/P&gt;&lt;P&gt;1&amp;nbsp; &lt;/P&gt;&lt;P&gt;2&amp;nbsp; &lt;/P&gt;&lt;P&gt;3&amp;nbsp; &lt;/P&gt;&lt;P&gt;];&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;FOR _i = 0 TO nbVal - 1&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; LET _val = peek('Field1', _i,'TableName');&amp;nbsp; &lt;STRONG&gt;//Give table name here when another table in between&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET _res = MsgBox('$(_val)');&amp;nbsp; &lt;/P&gt;&lt;P&gt;NEXT _i&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2015 14:08:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-peek/m-p/939472#M647034</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-08T14:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with peek()</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-peek/m-p/939473#M647035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Indeed, but I would like to understand why.&lt;/P&gt;&lt;P&gt;The "Field1" field is only in the table "Table1". Why do I have to make the precision?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2015 14:12:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-peek/m-p/939473#M647035</guid>
      <dc:creator>nicolas_martin</dc:creator>
      <dc:date>2015-10-08T14:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with peek()</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-peek/m-p/939474#M647036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'Droid Sans', Arial, Helvetica, 'Nimbus Sans L', sans-serif; color: #505050;"&gt;The Peek() function can be used in a load to retrieve data from the same table or from another table. in these case the table name is mandatory, as table which we are refering is not immediate table in the script.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2015 14:16:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-peek/m-p/939474#M647036</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-08T14:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with peek()</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-peek/m-p/939475#M647037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The Reference manual states that if the Tablename argument is not specified, the current table is assumed. If you want to refer any table other than the current table, you need to specify the table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2015 14:22:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-peek/m-p/939475#M647037</guid>
      <dc:creator>nagaiank</dc:creator>
      <dc:date>2015-10-08T14:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with peek()</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-peek/m-p/939476#M647038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I misunderstood the meaning of the phrase in the Reference Manual.&lt;/P&gt;&lt;P&gt;I thought it was "it takes the last table having this field".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2015 14:42:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-peek/m-p/939476#M647038</guid>
      <dc:creator>nicolas_martin</dc:creator>
      <dc:date>2015-10-08T14:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with peek()</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-peek/m-p/939477#M647039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nicolas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'Droid Sans', Arial, Helvetica, 'Nimbus Sans L', sans-serif; color: #505050;"&gt;The Peek() function can be used in a load to retrieve data from the same table or from another table. in these case the table name is mandatory, as table which we are refering is not immediate(Current) table in the script.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2015 14:43:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-peek/m-p/939477#M647039</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-08T14:43:47Z</dc:date>
    </item>
  </channel>
</rss>

