<?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 compare value to list error in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/compare-value-to-list-error/m-p/545220#M686836</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to compare a variable to match a list, something like 'IN' in SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I create a variable containing&amp;nbsp; a list, and how to I compare a certain variable with 1 string to the list variable and check whether it is in the list.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;is this correct?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;let vTest = '1;2;3';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;let vTemp= '1';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;if match ('$(vTemp)','$(vTest)')&amp;nbsp; then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Boris &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Jan 2014 13:33:54 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-01-02T13:33:54Z</dc:date>
    <item>
      <title>compare value to list error</title>
      <link>https://community.qlik.com/t5/QlikView/compare-value-to-list-error/m-p/545220#M686836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to compare a variable to match a list, something like 'IN' in SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I create a variable containing&amp;nbsp; a list, and how to I compare a certain variable with 1 string to the list variable and check whether it is in the list.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;is this correct?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;let vTest = '1;2;3';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;let vTemp= '1';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;if match ('$(vTemp)','$(vTest)')&amp;nbsp; then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Boris &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jan 2014 13:33:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/compare-value-to-list-error/m-p/545220#M686836</guid>
      <dc:creator />
      <dc:date>2014-01-02T13:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: compare value to list error</title>
      <link>https://community.qlik.com/t5/QlikView/compare-value-to-list-error/m-p/545221#M686838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your list of values in the match functions needs to be delimited by a comma, and you need to take care of quotation when comparing strings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So this should work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set vTest = "'Aa','B','C'";&lt;/P&gt;&lt;P&gt;Set vTemp= "'Aa'";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF Match ($(vTemp),$(vTest))&amp;nbsp; then &lt;/P&gt;&lt;P&gt;&amp;nbsp; TRACE Success;&lt;/P&gt;&lt;P&gt;ELSE&lt;/P&gt;&lt;P&gt;&amp;nbsp; TRACE NOSUCCESS;&lt;/P&gt;&lt;P&gt;ENDIF;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jan 2014 13:45:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/compare-value-to-list-error/m-p/545221#M686838</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2014-01-02T13:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: compare value to list error</title>
      <link>https://community.qlik.com/t5/QlikView/compare-value-to-list-error/m-p/545222#M686840</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;You can do this with &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If index(vTest, vTemp) &amp;gt; 0 Then&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/EM&gt;or&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If index(';' &amp;amp; vTest &amp;amp; ';', ';' &amp;amp; vTemp &amp;amp; ';') &amp;gt; 0 Then&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&lt;/EM&gt;(exact matches)&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if you need to use match, then:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;let vTest = '1;2;3';&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;let vTemp = '1';&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Let vList = chr(39) &amp;amp; Replace(vTest, ';', chr(39) &amp;amp; ',' &amp;amp; chr(39)) &amp;amp; chr(39);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If Match(vTemp, $(vList)) Then &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that there are NO quotes in the Match expression, they have been added beforehand (chr(39))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jan 2014 13:53:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/compare-value-to-list-error/m-p/545222#M686840</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2014-01-02T13:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: compare value to list error</title>
      <link>https://community.qlik.com/t5/QlikView/compare-value-to-list-error/m-p/545223#M686842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The list is created by a load script in which I add to this list ID numbers from a table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; TempList: &lt;/P&gt;&lt;P&gt;&amp;nbsp; LOAD concat(RUN_ID,',') as RUN_IDList&lt;/P&gt;&lt;P&gt;&amp;nbsp; from 'c:\DATA_TABLE.qvd' (qvd)&lt;/P&gt;&lt;P&gt;&amp;nbsp; let vRunIdList=peek('RUN_IDList',0,TempList);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any recommendations to this list creation? and to the match function?&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, 02 Jan 2014 14:09:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/compare-value-to-list-error/m-p/545223#M686842</guid>
      <dc:creator />
      <dc:date>2014-01-02T14:09:29Z</dc:date>
    </item>
    <item>
      <title>Re: compare value to list error</title>
      <link>https://community.qlik.com/t5/QlikView/compare-value-to-list-error/m-p/545224#M686844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try with WildMatch function like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;let vTest = '1;2;3';&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;let vTemp= '1';&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;if WildMatch('$(vTemp)','$(vTest)')&amp;nbsp; then&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jan 2014 20:36:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/compare-value-to-list-error/m-p/545224#M686844</guid>
      <dc:creator />
      <dc:date>2014-01-02T20:36:40Z</dc:date>
    </item>
  </channel>
</rss>

