<?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: List from table field to pass to SQL In clause in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/List-from-table-field-to-pass-to-SQL-In-clause/m-p/2511077#M105002</link>
    <description>&lt;P&gt;Try to debug the variable&amp;nbsp;&lt;/P&gt;&lt;P&gt;TRACE vFILT_LIST: $(vFILT_LIST);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 22 Mar 2025 16:56:37 GMT</pubDate>
    <dc:creator>Chanty4u</dc:creator>
    <dc:date>2025-03-22T16:56:37Z</dc:date>
    <item>
      <title>List from table field to pass to SQL In clause</title>
      <link>https://community.qlik.com/t5/App-Development/List-from-table-field-to-pass-to-SQL-In-clause/m-p/2511034#M104989</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;I am attempting to limit the scope of multiple SQL queries with In clauses by creating a list from a QlikView table. To do so, I have a subroutine that can be easily recycled:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;SUB SQL_FILT_LIST(SRC_TABLE, SRC_COL)&lt;BR /&gt;TEMP:&lt;BR /&gt;NoConcatenate&lt;/P&gt;
&lt;P&gt;LOAD&lt;BR /&gt;CONCAT(''''&amp;amp;$(SRC_COL)&amp;amp;'''', ',') AS TARGET&lt;BR /&gt;RESIDENT $(SRC_TABLE);&lt;BR /&gt;&lt;BR /&gt;LET vFILT_LIST = PEEK('TARGET');&lt;BR /&gt;DROP TABLE TEMP;&lt;BR /&gt;END SUB;&lt;BR /&gt;&lt;BR /&gt;Assuming I have a resident table GRPIDS with a field named GRPID, I can use:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;CALL SQL_FILT_LIST('GRPIDS', 'GRPID');&lt;/P&gt;
&lt;P&gt;to define vFILT_LIST and pass it to a SQL query ending with:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;and GRPID IN ($(vFILT_LIST));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This works beautifully when I reload the script on my machine, but throws Error in expression: ')' expected upon execution of the subroutine when another user tries to reload.&lt;/P&gt;
&lt;P&gt;Any ideas why? Is there a better way to accomplish this and avoid the error?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Mar 2025 19:24:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/List-from-table-field-to-pass-to-SQL-In-clause/m-p/2511034#M104989</guid>
      <dc:creator>rbotham</dc:creator>
      <dc:date>2025-03-21T19:24:27Z</dc:date>
    </item>
    <item>
      <title>Re: List from table field to pass to SQL In clause</title>
      <link>https://community.qlik.com/t5/App-Development/List-from-table-field-to-pass-to-SQL-In-clause/m-p/2511077#M105002</link>
      <description>&lt;P&gt;Try to debug the variable&amp;nbsp;&lt;/P&gt;&lt;P&gt;TRACE vFILT_LIST: $(vFILT_LIST);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Mar 2025 16:56:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/List-from-table-field-to-pass-to-SQL-In-clause/m-p/2511077#M105002</guid>
      <dc:creator>Chanty4u</dc:creator>
      <dc:date>2025-03-22T16:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: List from table field to pass to SQL In clause</title>
      <link>https://community.qlik.com/t5/App-Development/List-from-table-field-to-pass-to-SQL-In-clause/m-p/2511082#M105004</link>
      <description>&lt;P&gt;It doesn't seem like it is an issue with the variable formatting, but rather in the subroutine that produces it. When I reload locally on my machine, I get no error, the variable is correctly formatted, and can be successfully passed to my SQL query. The&amp;nbsp;trace function prints &lt;BR /&gt;&lt;BR /&gt;vFILT_LIST: 'GRPID1', 'GRPID2', 'GRPID3'...&lt;BR /&gt;&lt;BR /&gt;However, when my colleague attempts to reload the script he is met with the attached error. It looks like it fails before the LET vFILT_LIST line is even executed.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Mar 2025 17:36:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/List-from-table-field-to-pass-to-SQL-In-clause/m-p/2511082#M105004</guid>
      <dc:creator>rbotham</dc:creator>
      <dc:date>2025-03-22T17:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: List from table field to pass to SQL In clause</title>
      <link>https://community.qlik.com/t5/App-Development/List-from-table-field-to-pass-to-SQL-In-clause/m-p/2511200#M105018</link>
      <description>&lt;P&gt;Maybe try this:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;CONCAT(chr(39)&amp;amp;$(SRC_COL)&amp;amp;chr(39), ',') AS TARGET&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Mar 2025 08:14:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/List-from-table-field-to-pass-to-SQL-In-clause/m-p/2511200#M105018</guid>
      <dc:creator>henrikalmen</dc:creator>
      <dc:date>2025-03-24T08:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: List from table field to pass to SQL In clause</title>
      <link>https://community.qlik.com/t5/App-Development/List-from-table-field-to-pass-to-SQL-In-clause/m-p/2511882#M105144</link>
      <description>&lt;P&gt;That worked great, also much more legible. Thank you!&lt;/P&gt;
&lt;P&gt;Any idea why the original implementation only worked on mine, not my colleagues machine? We've run into a few other strange errors when reloading on his side that I'm unable to reproduce. He's running QlikView version 11.00.11149.0 while I have 12.8.20200.0&lt;/P&gt;</description>
      <pubDate>Thu, 27 Mar 2025 13:29:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/List-from-table-field-to-pass-to-SQL-In-clause/m-p/2511882#M105144</guid>
      <dc:creator>rbotham</dc:creator>
      <dc:date>2025-03-27T13:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: List from table field to pass to SQL In clause</title>
      <link>https://community.qlik.com/t5/App-Development/List-from-table-field-to-pass-to-SQL-In-clause/m-p/2511884#M105145</link>
      <description>&lt;P&gt;Well, I'd say you answered your own question there. If I remember correctly there were kind of unusually big changes when QV12 arrived, compared to QV11. I don't know exactly why this particular thing differs between version, but QV11.0 is a really old product version by now. Differences are expected. (Everything that works in 11 should work in 12, but not the other way around.)&lt;/P&gt;</description>
      <pubDate>Thu, 27 Mar 2025 13:38:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/List-from-table-field-to-pass-to-SQL-In-clause/m-p/2511884#M105145</guid>
      <dc:creator>henrikalmen</dc:creator>
      <dc:date>2025-03-27T13:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: List from table field to pass to SQL In clause</title>
      <link>https://community.qlik.com/t5/App-Development/List-from-table-field-to-pass-to-SQL-In-clause/m-p/2511891#M105146</link>
      <description>&lt;P&gt;Ha, that's kind of what I figured. I couldn't think of any other reason we'd be seeing the difference but wasn't sure about what exactly had changed between the versions.&lt;/P&gt;
&lt;P&gt;I already told him to update - that subroutine cut reload times on some of our stuff literally in half and I really didn't want to roll everything back.&amp;nbsp;FWIW, your fix worked great on both. Thank you again!&lt;/P&gt;</description>
      <pubDate>Thu, 27 Mar 2025 13:58:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/List-from-table-field-to-pass-to-SQL-In-clause/m-p/2511891#M105146</guid>
      <dc:creator>rbotham</dc:creator>
      <dc:date>2025-03-27T13:58:06Z</dc:date>
    </item>
  </channel>
</rss>

