<?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: Selecting a list of values from a QVD and using in SQL in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Selecting-a-list-of-values-from-a-QVD-and-using-in-SQL/m-p/1344898#M619935</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can create variable like below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SET Var = 1,2,3,4,5;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Appraoch1:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;LOAD * inline [&lt;/P&gt;&lt;P&gt;ID|First name|Last name|Initials|Has cellphone&lt;/P&gt;&lt;P&gt;1|John|Anderson|JA|Yes&lt;/P&gt;&lt;P&gt;2|Sue|Brown|SB|Yes&lt;/P&gt;&lt;P&gt;3|Mark|Carr|MC |No&lt;/P&gt;&lt;P&gt;4|Peter|Devonshire|PD|No&lt;/P&gt;&lt;P&gt;5|Jane|Elliot|JE|Yes&lt;/P&gt;&lt;P&gt;6|Peter|Franc|PF|Yes ] (delimiter is '|') &lt;STRONG&gt;Where Match(ID, $(Var))&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In you orient, You can try something like below&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;Appraoch2:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;SELECT * FROM PEOPLE WHERE &lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;Match(ID, $(Var))&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Apr 2017 17:20:28 GMT</pubDate>
    <dc:creator>Anil_Babu_Samineni</dc:creator>
    <dc:date>2017-04-19T17:20:28Z</dc:date>
    <item>
      <title>Selecting a list of values from a QVD and using in SQL</title>
      <link>https://community.qlik.com/t5/QlikView/Selecting-a-list-of-values-from-a-QVD-and-using-in-SQL/m-p/1344897#M619934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm looking to select a list of from a QVD and use the list of values in a SQL IN Clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example if my data was the following:&lt;/P&gt;&lt;P&gt;LOAD * inline [&lt;/P&gt;&lt;P&gt;"ID|"First name"|"Last name"|Initials|"Has cellphone"&lt;/P&gt;&lt;P&gt;1|John|Anderson|JA|Yes&lt;/P&gt;&lt;P&gt;2|Sue|Brown|SB|Yes&lt;/P&gt;&lt;P&gt;3|Mark|Carr|MC |No&lt;/P&gt;&lt;P&gt;4|Peter|Devonshire|PD|No&lt;/P&gt;&lt;P&gt;5|Jane|Elliot|JE|Yes&lt;/P&gt;&lt;P&gt;6|Peter|Franc|PF|Yes ] (delimiter is '|');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would want a variable that would look like ID_LIST(1,2,3,4,5,6)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I would take that variable and use it in my SQL:&lt;/P&gt;&lt;P&gt;SELECT * FROM PEOPLE WHERE ID in($ID_LIST);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been trying to use getfieldselections to get the data from my ID and getting an unknown statement error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any thoughts?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Apr 2017 17:08:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selecting-a-list-of-values-from-a-QVD-and-using-in-SQL/m-p/1344897#M619934</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-04-19T17:08:34Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting a list of values from a QVD and using in SQL</title>
      <link>https://community.qlik.com/t5/QlikView/Selecting-a-list-of-values-from-a-QVD-and-using-in-SQL/m-p/1344898#M619935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can create variable like below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SET Var = 1,2,3,4,5;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Appraoch1:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;LOAD * inline [&lt;/P&gt;&lt;P&gt;ID|First name|Last name|Initials|Has cellphone&lt;/P&gt;&lt;P&gt;1|John|Anderson|JA|Yes&lt;/P&gt;&lt;P&gt;2|Sue|Brown|SB|Yes&lt;/P&gt;&lt;P&gt;3|Mark|Carr|MC |No&lt;/P&gt;&lt;P&gt;4|Peter|Devonshire|PD|No&lt;/P&gt;&lt;P&gt;5|Jane|Elliot|JE|Yes&lt;/P&gt;&lt;P&gt;6|Peter|Franc|PF|Yes ] (delimiter is '|') &lt;STRONG&gt;Where Match(ID, $(Var))&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In you orient, You can try something like below&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;Appraoch2:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;SELECT * FROM PEOPLE WHERE &lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;Match(ID, $(Var))&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Apr 2017 17:20:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selecting-a-list-of-values-from-a-QVD-and-using-in-SQL/m-p/1344898#M619935</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-04-19T17:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting a list of values from a QVD and using in SQL</title>
      <link>https://community.qlik.com/t5/QlikView/Selecting-a-list-of-values-from-a-QVD-and-using-in-SQL/m-p/1344899#M619936</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;Try something like this:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;MyTable:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD &lt;STRONG&gt;Concat(ID, ',') as ID_List&lt;/STRONG&gt; inline [&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;"ID|"First name"|"Last name"|Initials|"Has cellphone"&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;1|John|Anderson|JA|Yes&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;2|Sue|Brown|SB|Yes&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;3|Mark|Carr|MC |No&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;4|Peter|Devonshire|PD|No&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;5|Jane|Elliot|JE|Yes&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;6|Peter|Franc|PF|Yes ] (delimiter is '|');&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LET vID_List = peek('ID_List',0,'MyTable');&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;MySQLTable:&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="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;SELECT * FROM PEOPLE WHERE ID in( &lt;STRONG&gt;$(vID_List)&lt;/STRONG&gt; );&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Apr 2017 17:22:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selecting-a-list-of-values-from-a-QVD-and-using-in-SQL/m-p/1344899#M619936</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2017-04-19T17:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting a list of values from a QVD and using in SQL</title>
      <link>https://community.qlik.com/t5/QlikView/Selecting-a-list-of-values-from-a-QVD-and-using-in-SQL/m-p/1344900#M619937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How would the table statement change if I was selecting from a QVD as opposed to building the table inline?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Apr 2017 17:32:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selecting-a-list-of-values-from-a-QVD-and-using-in-SQL/m-p/1344900#M619937</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-04-19T17:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting a list of values from a QVD and using in SQL</title>
      <link>https://community.qlik.com/t5/QlikView/Selecting-a-list-of-values-from-a-QVD-and-using-in-SQL/m-p/1344901#M619938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Replace&lt;EM&gt; inline [ .... ]&lt;/EM&gt;&amp;nbsp; with &lt;EM&gt;FROM qvdname.qvd (qvd)&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Apr 2017 17:38:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selecting-a-list-of-values-from-a-QVD-and-using-in-SQL/m-p/1344901#M619938</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2017-04-19T17:38:59Z</dc:date>
    </item>
  </channel>
</rss>

