<?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 if match logic not working on multiple strings in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/if-match-logic-not-working-on-multiple-strings/m-p/1877250#M72316</link>
    <description>&lt;P&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;In loadscript, I have a function in my table where i want&amp;nbsp; to compare the field "id", to multiple values, if it matches a set of values, have status as 'Live' otherwise, get status from existing status field in table. However, it is only comparing against the first value, 87 and only lists it as Live, while the remaining 4 IDs arent live.&lt;BR /&gt;&lt;BR /&gt;When i load the table and look at id 1403 for example, it still says 'Testing' instead of 'Live' which according to the formula should not be the case&lt;BR /&gt;&lt;BR /&gt;if(match(id, '87','1403','3082','322','518') = 1, 'Live',release_status) as release_status2,&lt;BR /&gt;&lt;BR /&gt;I have also tried with wildmatch and * around the numbers but its the same result where only the row with ID 87 says live and none of the other IDs have teh appropriate release_status2 value&lt;BR /&gt;&lt;BR /&gt;what am i doing wrong here?&lt;/P&gt;</description>
    <pubDate>Wed, 05 Jan 2022 03:33:13 GMT</pubDate>
    <dc:creator>Panv</dc:creator>
    <dc:date>2022-01-05T03:33:13Z</dc:date>
    <item>
      <title>if match logic not working on multiple strings</title>
      <link>https://community.qlik.com/t5/App-Development/if-match-logic-not-working-on-multiple-strings/m-p/1877250#M72316</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;In loadscript, I have a function in my table where i want&amp;nbsp; to compare the field "id", to multiple values, if it matches a set of values, have status as 'Live' otherwise, get status from existing status field in table. However, it is only comparing against the first value, 87 and only lists it as Live, while the remaining 4 IDs arent live.&lt;BR /&gt;&lt;BR /&gt;When i load the table and look at id 1403 for example, it still says 'Testing' instead of 'Live' which according to the formula should not be the case&lt;BR /&gt;&lt;BR /&gt;if(match(id, '87','1403','3082','322','518') = 1, 'Live',release_status) as release_status2,&lt;BR /&gt;&lt;BR /&gt;I have also tried with wildmatch and * around the numbers but its the same result where only the row with ID 87 says live and none of the other IDs have teh appropriate release_status2 value&lt;BR /&gt;&lt;BR /&gt;what am i doing wrong here?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 03:33:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/if-match-logic-not-working-on-multiple-strings/m-p/1877250#M72316</guid>
      <dc:creator>Panv</dc:creator>
      <dc:date>2022-01-05T03:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: if match logic not working on multiple strings</title>
      <link>https://community.qlik.com/t5/App-Development/if-match-logic-not-working-on-multiple-strings/m-p/1877251#M72317</link>
      <description>&lt;P&gt;Match() returns the index number of the matching element. So given&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;match(id, '87','1403','3082','322','518')&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;id = 1403 would return 2.&amp;nbsp; So the problem is with your if test.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;match(id, '87','1403','3082','322','518') &lt;STRONG&gt;= 1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;would only be true for 87.&amp;nbsp; Instead use&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;match(id, '87','1403','3082','322','518')&amp;nbsp; &lt;STRONG&gt;&amp;gt; 0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;or just&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;match(id, '87','1403','3082','322','518')&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;-Rob&lt;BR /&gt;&lt;A href="http://www.easyqlik.com" target="_blank" rel="noopener"&gt;http://www.easyqlik.com&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://masterssummit.com" target="_blank" rel="noopener"&gt;http://masterssummit.com&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://qlikviewcookbook.com" target="_blank" rel="noopener"&gt;http://qlikviewcookbook.com&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 03:41:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/if-match-logic-not-working-on-multiple-strings/m-p/1877251#M72317</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2022-01-05T03:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: if match logic not working on multiple strings</title>
      <link>https://community.qlik.com/t5/App-Development/if-match-logic-not-working-on-multiple-strings/m-p/1877252#M72318</link>
      <description>&lt;P&gt;ah, perfect thank you!! I was thinking its a binary response, based on if it matches or not&lt;BR /&gt;&lt;BR /&gt;&amp;gt;0 was able to fix ti , ty!&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 03:48:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/if-match-logic-not-working-on-multiple-strings/m-p/1877252#M72318</guid>
      <dc:creator>Panv</dc:creator>
      <dc:date>2022-01-05T03:48:29Z</dc:date>
    </item>
  </channel>
</rss>

