<?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: Peek only showing first value in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Peek-only-showing-first-value/m-p/1089108#M362368</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;Thanks very much for the solution - I got it to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why does Peek jump forward one value resulting in having to do &lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;$(i)-1 ?&amp;nbsp; &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Stuart&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Jan 2016 12:27:42 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-01-28T12:27:42Z</dc:date>
    <item>
      <title>Peek only showing first value</title>
      <link>https://community.qlik.com/t5/QlikView/Peek-only-showing-first-value/m-p/1089104#M362364</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;I have some script that loads in a list of active segments and creates a list of filenames that we want to load. All of that stuff works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each time a file is loaded I also want to put the name of the segment in as a field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script works for the first file we load but for the subsequent loads the segment is blank. What am I doing wrong here with the variable&amp;nbsp; vSeg ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//-O_O-// Auto create the filenames based on the current reporting month&lt;/P&gt;&lt;P&gt;ACTIVE_SEGMENTS_0:&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;SEGMENT,&lt;/P&gt;&lt;P&gt;OPERATIONAL,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(vReportingYear) &amp;amp; $(vReportingMonthNumber) &amp;amp;'_'&amp;amp; SEGMENT &amp;amp;'_'&amp;amp; 'Party.txt' as FILENAME&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FROM $(vSourceData)ACTIVE_SEGMENTS.xlsx&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Sheet1)&lt;/P&gt;&lt;P&gt;WHERE OPERATIONAL = 1;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;//-O_O-// Load the filenames that we want to loop through&lt;/P&gt;&lt;P&gt;ACTIVE_SEGMENTS:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Concat(FILENAME, '|') as List,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Count(FILENAME) as Count&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RESIDENT ACTIVE_SEGMENTS_0&lt;/P&gt;&lt;P&gt;WHERE OPERATIONAL = 1;&lt;/P&gt;&lt;P&gt;//DROP TABLE ACTIVE_SEGMENTS_0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//-O_O-// Set up the loop&lt;/P&gt;&lt;P&gt;LET vList = Chr(39) &amp;amp; Peek('List') &amp;amp; Chr(39);&lt;/P&gt;&lt;P&gt;LET vCount = Peek('Count');&lt;/P&gt;&lt;P&gt;FOR i = 1 to $(vCount)&lt;/P&gt;&lt;P&gt;LET vFile = SubField($(vList), '|', $(i));&lt;/P&gt;&lt;P&gt;LET vSeg = Peek('SEGMENT',i,'ACTIVE_SEGMENTS_0');&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//-O_O-// Start a blank table structure which we will then concatenate to later&lt;/P&gt;&lt;P&gt;Party:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [ CUS_IDR, SEGMENT&amp;nbsp; ];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//-O_O-// Concatenate the data&lt;/P&gt;&lt;P&gt;CONCATENATE(Party)&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; distinct(CUS_IDR) as CUS_IDR,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '$(vSeg)'&amp;nbsp; as SEGMENT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[$(vOperational)$(vFile)]&lt;/P&gt;&lt;P&gt;(txt, utf8, embedded labels, delimiter is '\t', no quotes, no eof);&lt;/P&gt;&lt;P&gt;//WHERE NOT EXISTS (CUS_IDR);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//-O_O-// Loop until we are finished&lt;/P&gt;&lt;P&gt;Next i;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//-O_O-// Tidy Up&lt;/P&gt;&lt;P&gt;DROP TABLE ACTIVE_SEGMENTS_0;&lt;/P&gt;&lt;P&gt;DROP TABLE ACTIVE_SEGMENTS;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jan 2016 08:36:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Peek-only-showing-first-value/m-p/1089104#M362364</guid>
      <dc:creator />
      <dc:date>2016-01-28T08:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: Peek only showing first value</title>
      <link>https://community.qlik.com/t5/QlikView/Peek-only-showing-first-value/m-p/1089105#M362365</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;Can you able to attach sample data in &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em;"&gt;ACTIVE_SEGMENTS file.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jan 2016 10:35:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Peek-only-showing-first-value/m-p/1089105#M362365</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2016-01-28T10:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: Peek only showing first value</title>
      <link>https://community.qlik.com/t5/QlikView/Peek-only-showing-first-value/m-p/1089106#M362366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ACTIVE_SEGMENTS attached&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jan 2016 11:12:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Peek-only-showing-first-value/m-p/1089106#M362366</guid>
      <dc:creator />
      <dc:date>2016-01-28T11:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: Peek only showing first value</title>
      <link>https://community.qlik.com/t5/QlikView/Peek-only-showing-first-value/m-p/1089107#M362367</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;Try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//-O_O-// Auto create the filenames based on the current reporting month&lt;/P&gt;&lt;P&gt;ACTIVE_SEGMENTS_0:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RowNo() as Rowno,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;SEGMENT,&lt;/P&gt;&lt;P&gt;OPERATIONAL,&lt;/P&gt;&lt;P&gt; SEGMENT &amp;amp;'_'&amp;amp; 'Party.txt' as FILENAME&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FROM ACTIVE_SEGMENTS.xlsx&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Sheet1)&lt;/P&gt;&lt;P&gt;WHERE OPERATIONAL = 1;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;//-O_O-// Load the filenames that we want to loop through&lt;/P&gt;&lt;P&gt;ACTIVE_SEGMENTS:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Concat(FILENAME, '|', Rowno) as List,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Count(FILENAME) as Count&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RESIDENT ACTIVE_SEGMENTS_0&lt;/P&gt;&lt;P&gt;WHERE OPERATIONAL = 1 &lt;/P&gt;&lt;P&gt;Order by Rowno asc;&lt;/P&gt;&lt;P&gt;//DROP TABLE ACTIVE_SEGMENTS_0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//-O_O-// Set up the loop&lt;/P&gt;&lt;P&gt;LET vList = Chr(39) &amp;amp; Peek('List') &amp;amp; Chr(39);&lt;/P&gt;&lt;P&gt;LET vCount = Peek('Count');&lt;/P&gt;&lt;P&gt;FOR i = 1 to $(vCount)&lt;/P&gt;&lt;P&gt;LET vFile = SubField($(vList), '|', $(i));&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LET vSeg = Peek('SEGMENT',$(i)-1,'ACTIVE_SEGMENTS_0');&amp;nbsp; &lt;/STRONG&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jan 2016 11:35:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Peek-only-showing-first-value/m-p/1089107#M362367</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2016-01-28T11:35:25Z</dc:date>
    </item>
    <item>
      <title>Re: Peek only showing first value</title>
      <link>https://community.qlik.com/t5/QlikView/Peek-only-showing-first-value/m-p/1089108#M362368</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;Thanks very much for the solution - I got it to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why does Peek jump forward one value resulting in having to do &lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;$(i)-1 ?&amp;nbsp; &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Stuart&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jan 2016 12:27:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Peek-only-showing-first-value/m-p/1089108#M362368</guid>
      <dc:creator />
      <dc:date>2016-01-28T12:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: Peek only showing first value</title>
      <link>https://community.qlik.com/t5/QlikView/Peek-only-showing-first-value/m-p/1089109#M362369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;Why does Peek jump forward one value resulting in having to do &lt;STRONG style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;$(i)-1 ?&amp;nbsp; &lt;SPAN class="emoticon-inline emoticon_happy" style="width: 16px; height: 16px;"&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P style="padding: 0px; min-height: 8pt;"&gt;&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's because some QV functions (like Peek() ) start indexing by 0 (while some other functions, like Subfield() start by 1). &lt;/P&gt;&lt;P&gt;Indexing is one of the last creative spaces left for developers...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jan 2016 12:56:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Peek-only-showing-first-value/m-p/1089109#M362369</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-01-28T12:56:45Z</dc:date>
    </item>
  </channel>
</rss>

