<?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 Fill an empty table with stuff. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Fill-an-empty-table-with-stuff/m-p/400266#M1159893</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;So I'm in qvscript and trying to fill an empty table with new stuff through a loop and an if-statement. If the if-statement is true I call a sub (that I put first in the script) that creates a string with variables from the if-statement. So far so good. Then my problem is creating an empty table and filling it with new strings for each time the if-statement is fullfilled. Ideally I would like that the table had two columns, one for the new string coming in, and if the same string comes up twice, in the next column I would like it to be counted. I think this is known as a hash table... sort of &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, how to do this? Do I create the empty table in the beginning of the script or in the Sub where each of the new strings are created? Any help would be much appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Jan 2013 18:30:38 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-01-07T18:30:38Z</dc:date>
    <item>
      <title>Fill an empty table with stuff.</title>
      <link>https://community.qlik.com/t5/QlikView/Fill-an-empty-table-with-stuff/m-p/400266#M1159893</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;So I'm in qvscript and trying to fill an empty table with new stuff through a loop and an if-statement. If the if-statement is true I call a sub (that I put first in the script) that creates a string with variables from the if-statement. So far so good. Then my problem is creating an empty table and filling it with new strings for each time the if-statement is fullfilled. Ideally I would like that the table had two columns, one for the new string coming in, and if the same string comes up twice, in the next column I would like it to be counted. I think this is known as a hash table... sort of &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, how to do this? Do I create the empty table in the beginning of the script or in the Sub where each of the new strings are created? Any help would be much appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2013 18:30:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fill-an-empty-table-with-stuff/m-p/400266#M1159893</guid>
      <dc:creator />
      <dc:date>2013-01-07T18:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: Fill an empty table with stuff.</title>
      <link>https://community.qlik.com/t5/QlikView/Fill-an-empty-table-with-stuff/m-p/400267#M1159894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This creates an empty table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NewTable:&lt;/P&gt;&lt;P&gt;Load '' as Field1, '' as Field2&lt;/P&gt;&lt;P&gt;autogenerate 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a loop you can do something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for i=1 to 100&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if 1=1 then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NewTable:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; load 'a' as Field1, 123 as Field2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; autogenerate 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end if&lt;/P&gt;&lt;P&gt;next i&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2013 18:58:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fill-an-empty-table-with-stuff/m-p/400267#M1159894</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-01-07T18:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: Fill an empty table with stuff.</title>
      <link>https://community.qlik.com/t5/QlikView/Fill-an-empty-table-with-stuff/m-p/400268#M1159895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Gysbert, thanx again!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can't get it to work though. I'm trying sort of like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Creating the empty table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NewTable:&lt;/P&gt;&lt;P&gt;Load '' as Field1, '' as Field2&lt;/P&gt;&lt;P&gt;autogenerate 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//My sub where i want to fill the table every time its called. Note that I want to fill one of the fields with pos, which is a string that is different each time it's called. Eventually I would like the second Field to have the count of the different pos coming in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub crtTw(a,b)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; let pos=a &amp;amp; ',' &amp;amp; b;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; load pos as Field1, 123 as Field2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; autogenerate 1;&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//My loop where my sub get's called when a certain condition is met.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for i=0 to 100&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; let s=Peek('RECEIPT_NUMBER',i,'table1');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; let t=Peek('RECEIPT_NUMBER',i+1,'table1');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if s=t then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; let a=Peek('%Key_Trans_Item',i,'table1');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; let b=Peek('%Key_Trans_Item',i+1,'table1');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CALL crtTw(a,b);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ENDIF&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &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;Not sure if this is comprehensible, but I'll throw it out anyway!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2013 21:18:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fill-an-empty-table-with-stuff/m-p/400268#M1159895</guid>
      <dc:creator />
      <dc:date>2013-01-07T21:18:34Z</dc:date>
    </item>
    <item>
      <title>Re: Fill an empty table with stuff.</title>
      <link>https://community.qlik.com/t5/QlikView/Fill-an-empty-table-with-stuff/m-p/400269#M1159896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;bumpin this!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Jan 2013 15:15:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fill-an-empty-table-with-stuff/m-p/400269#M1159896</guid>
      <dc:creator />
      <dc:date>2013-01-12T15:15:25Z</dc:date>
    </item>
  </channel>
</rss>

