<?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 Iterate over table values and construct strings? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Iterate-over-table-values-and-construct-strings/m-p/224140#M76588</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe something along these lines, but I'm rather unclear on the DETAILS of what you're trying to do... is "key1" a value or a field in keytable? Is ", key, " an actual value in your source table, or am I supposed to be substituting something there? Sure doesn't look like a value, but no idea what I'd be substituting. Blah blah blah other questions blah blah blah.&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;[New Table]:&lt;BR /&gt; LOAD *; SQL SELECT * FROM table WHERE $(=peek('key',I,'keytable')) = ", key, ";&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;FOR I = 0 TO noofrows('keytable')-1&lt;BR /&gt; CONCATENATE ([New Table])&lt;BR /&gt; LOAD *; SQL SELECT * FROM table WHERE $(=peek('key',I,'keytable')) = ", key, ";&lt;BR /&gt;NEXT I&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Apr 2010 21:14:08 GMT</pubDate>
    <dc:creator>johnw</dc:creator>
    <dc:date>2010-04-23T21:14:08Z</dc:date>
    <item>
      <title>Iterate over table values and construct strings?</title>
      <link>https://community.qlik.com/t5/QlikView/Iterate-over-table-values-and-construct-strings/m-p/224139#M76587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a set of key values in a qlikview table:&lt;/P&gt;&lt;P&gt;keytable:&lt;BR /&gt;key1, key2, key3, ...&lt;/P&gt;&lt;P&gt;I want to iterate through these, construct SQL statements, and run the SQL statements and append the results into a new table.&lt;/P&gt;&lt;P&gt;for each key in keytable&lt;/P&gt;&lt;P&gt;LET SQL = "SELECT * FROM table WHERE key=", key, ";"&lt;BR /&gt; LOAD SQL;&lt;/P&gt;&lt;P&gt;Has anyone done something like this before? Any recommendations for how to do this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Apr 2010 20:56:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Iterate-over-table-values-and-construct-strings/m-p/224139#M76587</guid>
      <dc:creator />
      <dc:date>2010-04-23T20:56:43Z</dc:date>
    </item>
    <item>
      <title>Iterate over table values and construct strings?</title>
      <link>https://community.qlik.com/t5/QlikView/Iterate-over-table-values-and-construct-strings/m-p/224140#M76588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe something along these lines, but I'm rather unclear on the DETAILS of what you're trying to do... is "key1" a value or a field in keytable? Is ", key, " an actual value in your source table, or am I supposed to be substituting something there? Sure doesn't look like a value, but no idea what I'd be substituting. Blah blah blah other questions blah blah blah.&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;[New Table]:&lt;BR /&gt; LOAD *; SQL SELECT * FROM table WHERE $(=peek('key',I,'keytable')) = ", key, ";&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;FOR I = 0 TO noofrows('keytable')-1&lt;BR /&gt; CONCATENATE ([New Table])&lt;BR /&gt; LOAD *; SQL SELECT * FROM table WHERE $(=peek('key',I,'keytable')) = ", key, ";&lt;BR /&gt;NEXT I&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Apr 2010 21:14:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Iterate-over-table-values-and-construct-strings/m-p/224140#M76588</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-04-23T21:14:08Z</dc:date>
    </item>
    <item>
      <title>Iterate over table values and construct strings?</title>
      <link>https://community.qlik.com/t5/QlikView/Iterate-over-table-values-and-construct-strings/m-p/224141#M76589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks John. That's perfect!&lt;/P&gt;&lt;P&gt;Now I don't suppose you would be able to show me how you could do this with a try...catch equivalent around the SELECT block? In some cases, I get an error message from SELECT statement, and I just want to skip those.&lt;/P&gt;&lt;P&gt;I read through this question, but it isn't clear to me:&lt;/P&gt;&lt;P&gt;&lt;A href="http://community.qlik.com/forums/p/16288/63539.aspx"&gt;http://community.qlik.com/forums/p/16288/63539.aspx&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Apr 2010 22:13:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Iterate-over-table-values-and-construct-strings/m-p/224141#M76589</guid>
      <dc:creator />
      <dc:date>2010-04-23T22:13:47Z</dc:date>
    </item>
    <item>
      <title>Iterate over table values and construct strings?</title>
      <link>https://community.qlik.com/t5/QlikView/Iterate-over-table-values-and-construct-strings/m-p/224142#M76590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, I haven't played with the error mode, so I'd just be reading other forum posts to figure it out too. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Apr 2010 22:26:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Iterate-over-table-values-and-construct-strings/m-p/224142#M76590</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-04-23T22:26:39Z</dc:date>
    </item>
  </channel>
</rss>

