<?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 Find value in a field in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Find-value-in-a-field/m-p/321655#M1199409</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I´d like to know how can I do to get a '0' if a value doesn´t exist in a field and a '1' if the value exist.&lt;/P&gt;&lt;P&gt;For example, I have this table:&lt;/P&gt;&lt;P style="font-weight: bold"&gt;T1:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt; F1&lt;BR /&gt; 'a'&lt;BR /&gt; 'a'&lt;BR /&gt; 'a'&lt;BR /&gt; 'b'&lt;BR /&gt; 'c'&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;And I´d like to know if 'z' value is in the F1 field, getting a '1' or a '0' if the value exist or not.&lt;/P&gt;&lt;P&gt;I´ve tried this&lt;/P&gt;&lt;P style="font-weight: bold"&gt;tmp:&lt;BR /&gt;LOAD COUNT(DISTINCT F1) as Found RESIDENT T1 WHERE F1='z';&lt;BR /&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;LET value= peek('Found',0,'tmp');&lt;/P&gt;&lt;P&gt;But the value is NULL and not '0' when 'z' is not in the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Apr 2011 17:01:45 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-04-14T17:01:45Z</dc:date>
    <item>
      <title>Find value in a field</title>
      <link>https://community.qlik.com/t5/QlikView/Find-value-in-a-field/m-p/321655#M1199409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I´d like to know how can I do to get a '0' if a value doesn´t exist in a field and a '1' if the value exist.&lt;/P&gt;&lt;P&gt;For example, I have this table:&lt;/P&gt;&lt;P style="font-weight: bold"&gt;T1:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt; F1&lt;BR /&gt; 'a'&lt;BR /&gt; 'a'&lt;BR /&gt; 'a'&lt;BR /&gt; 'b'&lt;BR /&gt; 'c'&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;And I´d like to know if 'z' value is in the F1 field, getting a '1' or a '0' if the value exist or not.&lt;/P&gt;&lt;P&gt;I´ve tried this&lt;/P&gt;&lt;P style="font-weight: bold"&gt;tmp:&lt;BR /&gt;LOAD COUNT(DISTINCT F1) as Found RESIDENT T1 WHERE F1='z';&lt;BR /&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;LET value= peek('Found',0,'tmp');&lt;/P&gt;&lt;P&gt;But the value is NULL and not '0' when 'z' is not in the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Apr 2011 17:01:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-value-in-a-field/m-p/321655#M1199409</guid>
      <dc:creator />
      <dc:date>2011-04-14T17:01:45Z</dc:date>
    </item>
    <item>
      <title>Find value in a field</title>
      <link>https://community.qlik.com/t5/QlikView/Find-value-in-a-field/m-p/321656#M1199410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can change your expression to:&lt;/P&gt;&lt;P&gt;LET value= NoOfRows('tmp');&lt;/P&gt;&lt;P&gt;An easier way might be to skip creating the tmp table and use fieldIndex().&lt;/P&gt;&lt;P&gt;LET value = if(fieldIndex('F1', 'z') &amp;gt; 0, 1, 0);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Apr 2011 18:54:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-value-in-a-field/m-p/321656#M1199410</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2011-04-14T18:54:55Z</dc:date>
    </item>
    <item>
      <title>Find value in a field</title>
      <link>https://community.qlik.com/t5/QlikView/Find-value-in-a-field/m-p/321657#M1199411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Apr 2011 07:56:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-value-in-a-field/m-p/321657#M1199411</guid>
      <dc:creator />
      <dc:date>2011-04-15T07:56:00Z</dc:date>
    </item>
  </channel>
</rss>

