<?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 A problem with exists()... in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/A-problem-with-exists/m-p/235314#M86577</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can't tell you if it's the best way as I have no idea what you're trying to accomplish. However, a standard approach is to add a copy of the key value to the first table, do an exists on that copy, then drop the copy.&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;Table1:&lt;BR /&gt;LOAD *,Letter as T1Letter INLINE [&lt;BR /&gt; Letter, Amount&lt;BR /&gt; A, 50&lt;BR /&gt; B, 75&lt;BR /&gt; C, 100&lt;BR /&gt;];&lt;BR /&gt;Table2:&lt;BR /&gt;LOAD *, if(exists(T1Letter,Letter),1,0) as Flag INLINE [&lt;BR /&gt; Letter, Invoice Number&lt;BR /&gt; A, 1&lt;BR /&gt; A,2&lt;BR /&gt; D,16&lt;BR /&gt; D, 14&lt;BR /&gt;];&lt;BR /&gt;DROP FIELD T1Letter;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Apr 2011 23:25:11 GMT</pubDate>
    <dc:creator>johnw</dc:creator>
    <dc:date>2011-04-29T23:25:11Z</dc:date>
    <item>
      <title>A problem with exists()...</title>
      <link>https://community.qlik.com/t5/QlikView/A-problem-with-exists/m-p/235312#M86575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Take this example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;Table1:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt; Letter, Amount&lt;BR /&gt; A, 50&lt;BR /&gt; B, 75&lt;BR /&gt; C, 100&lt;BR /&gt;];&lt;BR /&gt;&lt;BR /&gt;Table2:&lt;BR /&gt;LOAD *, if(exists(Letter),1,0) as 'Flag' INLINE [&lt;BR /&gt; Letter, Invoice Number&lt;BR /&gt; A, 1&lt;BR /&gt; A,2&lt;BR /&gt; D,16&lt;BR /&gt; D, 14&lt;BR /&gt;];&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;That will how the first D in table 2 as a flag of 0, and the second D will have a flag of 1 because it exists in that table. However, what I really want to say is:&lt;/P&gt;&lt;P&gt;"if Letter exists in Table1, 1, else 0"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way to do that? I don't see anything in the reference manual about specifying a table name in the exists function which shocks me... surely there is a way to do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Apr 2011 17:22:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/A-problem-with-exists/m-p/235312#M86575</guid>
      <dc:creator />
      <dc:date>2011-04-29T17:22:54Z</dc:date>
    </item>
    <item>
      <title>A problem with exists()...</title>
      <link>https://community.qlik.com/t5/QlikView/A-problem-with-exists/m-p/235313#M86576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Seconds after posting this I realized I should probably just use MAPPING LOAD for the first table and applymap( instead of exists... but is that the best way?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Apr 2011 17:33:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/A-problem-with-exists/m-p/235313#M86576</guid>
      <dc:creator />
      <dc:date>2011-04-29T17:33:48Z</dc:date>
    </item>
    <item>
      <title>A problem with exists()...</title>
      <link>https://community.qlik.com/t5/QlikView/A-problem-with-exists/m-p/235314#M86577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can't tell you if it's the best way as I have no idea what you're trying to accomplish. However, a standard approach is to add a copy of the key value to the first table, do an exists on that copy, then drop the copy.&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;Table1:&lt;BR /&gt;LOAD *,Letter as T1Letter INLINE [&lt;BR /&gt; Letter, Amount&lt;BR /&gt; A, 50&lt;BR /&gt; B, 75&lt;BR /&gt; C, 100&lt;BR /&gt;];&lt;BR /&gt;Table2:&lt;BR /&gt;LOAD *, if(exists(T1Letter,Letter),1,0) as Flag INLINE [&lt;BR /&gt; Letter, Invoice Number&lt;BR /&gt; A, 1&lt;BR /&gt; A,2&lt;BR /&gt; D,16&lt;BR /&gt; D, 14&lt;BR /&gt;];&lt;BR /&gt;DROP FIELD T1Letter;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Apr 2011 23:25:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/A-problem-with-exists/m-p/235314#M86577</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-04-29T23:25:11Z</dc:date>
    </item>
    <item>
      <title>A problem with exists()...</title>
      <link>https://community.qlik.com/t5/QlikView/A-problem-with-exists/m-p/235315#M86578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So you're saying that since I can't specify a specific table name I should make a new table, give that field a different name, and and do the exists on that field? Not exactly perfect but still genius, thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2011 15:20:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/A-problem-with-exists/m-p/235315#M86578</guid>
      <dc:creator />
      <dc:date>2011-05-02T15:20:35Z</dc:date>
    </item>
  </channel>
</rss>

