<?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 From two tables, create a third table. Consoldiate keys and create new column based on a conditional. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/From-two-tables-create-a-third-table-Consoldiate-keys-and-create/m-p/206799#M62788</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I'm pretty new to QlikView and SQL.&lt;BR /&gt;I am loading two tables from two different sources.&lt;BR /&gt;For simplicity, say they look like:&lt;BR /&gt;&lt;BR /&gt;Table1:&lt;BR /&gt;Load * Inline&lt;BR /&gt;[Key, Subkey, A&lt;BR /&gt;1, 1.1, a&lt;BR /&gt;2, 2.1, b&lt;BR /&gt;2, 2.2, c&lt;BR /&gt;5, 5.1, d&lt;BR /&gt;5, 5.2, e];&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Table2:&lt;BR /&gt;Load * Inline&lt;BR /&gt;[Key, B&lt;BR /&gt;1, f&lt;BR /&gt;3, g&lt;BR /&gt;4, h&lt;BR /&gt;5, i];&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I want to create a new table, that consolidates all the keys (all 1-5), with a column C such that C = A if the key exists in Table 1; else C = B.&lt;BR /&gt;&lt;BR /&gt;That is, if(Table1.A is a value, Table1.A, Table2.B)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Want:&lt;BR /&gt;Load * Inline&lt;BR /&gt;[Key, Subkey, C&lt;BR /&gt;1, 1.1, a&lt;BR /&gt;2, 2.1, b&lt;BR /&gt;2, 2.2, c&lt;BR /&gt;3, -, g&lt;BR /&gt;4, -, h&lt;BR /&gt;5, 5.1, d&lt;BR /&gt;5, 5.2, e];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated, thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Feb 2011 00:13:40 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-02-09T00:13:40Z</dc:date>
    <item>
      <title>From two tables, create a third table. Consoldiate keys and create new column based on a conditional.</title>
      <link>https://community.qlik.com/t5/QlikView/From-two-tables-create-a-third-table-Consoldiate-keys-and-create/m-p/206799#M62788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I'm pretty new to QlikView and SQL.&lt;BR /&gt;I am loading two tables from two different sources.&lt;BR /&gt;For simplicity, say they look like:&lt;BR /&gt;&lt;BR /&gt;Table1:&lt;BR /&gt;Load * Inline&lt;BR /&gt;[Key, Subkey, A&lt;BR /&gt;1, 1.1, a&lt;BR /&gt;2, 2.1, b&lt;BR /&gt;2, 2.2, c&lt;BR /&gt;5, 5.1, d&lt;BR /&gt;5, 5.2, e];&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Table2:&lt;BR /&gt;Load * Inline&lt;BR /&gt;[Key, B&lt;BR /&gt;1, f&lt;BR /&gt;3, g&lt;BR /&gt;4, h&lt;BR /&gt;5, i];&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I want to create a new table, that consolidates all the keys (all 1-5), with a column C such that C = A if the key exists in Table 1; else C = B.&lt;BR /&gt;&lt;BR /&gt;That is, if(Table1.A is a value, Table1.A, Table2.B)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Want:&lt;BR /&gt;Load * Inline&lt;BR /&gt;[Key, Subkey, C&lt;BR /&gt;1, 1.1, a&lt;BR /&gt;2, 2.1, b&lt;BR /&gt;2, 2.2, c&lt;BR /&gt;3, -, g&lt;BR /&gt;4, -, h&lt;BR /&gt;5, 5.1, d&lt;BR /&gt;5, 5.2, e];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated, thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Feb 2011 00:13:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/From-two-tables-create-a-third-table-Consoldiate-keys-and-create/m-p/206799#M62788</guid>
      <dc:creator />
      <dc:date>2011-02-09T00:13:40Z</dc:date>
    </item>
    <item>
      <title>From two tables, create a third table. Consoldiate keys and create new column based on a conditional.</title>
      <link>https://community.qlik.com/t5/QlikView/From-two-tables-create-a-third-table-Consoldiate-keys-and-create/m-p/206800#M62789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can do this by creating a straight table chart.&lt;/P&gt;&lt;P&gt;In dimensions, add Key and Subkey as dimensions&lt;/P&gt;&lt;P&gt;In expressions, insert into definition if (isnull(Subkey),B,A);&lt;/P&gt;&lt;P&gt;insert "C" into label.&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width:222pt;border-collapse:collapse;" width="294"&gt;&lt;COLGROUP&gt;&lt;COL span="3" style="width:74pt;mso-width-source:userset;mso-width-alt:3584;" width="98" /&gt;&lt;/COLGROUP&gt;&lt;TBODY&gt;&lt;TR style="height:12.75pt;"&gt;&lt;TD class="xl63" height="17" style="background-color:whitesmoke;width:74pt;height:12.75pt;border:gainsboro 0.5pt solid;" width="98"&gt;&lt;STRONG&gt;Key&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-bottom:gainsboro 0.5pt solid;border-left:gainsboro;background-color:whitesmoke;width:74pt;border-top:gainsboro 0.5pt solid;border-right:gainsboro 0.5pt solid;" width="98"&gt;&lt;STRONG&gt;Subkey&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-bottom:gainsboro 0.5pt solid;border-left:gainsboro;background-color:whitesmoke;width:74pt;border-top:gainsboro 0.5pt solid;border-right:gainsboro 0.5pt solid;" width="98"&gt;&lt;STRONG&gt;C&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height:12.75pt;"&gt;&lt;TD class="xl64" height="17" style="border-bottom:gainsboro 0.5pt solid;border-left:#f0f0f0;background-color:whitesmoke;height:12.75pt;border-top:gainsboro;border-right:#f0f0f0;"&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl64" style="border-bottom:gainsboro 0.5pt solid;border-left:#f0f0f0;background-color:whitesmoke;border-top:gainsboro;border-right:#f0f0f0;"&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-bottom:gainsboro 0.5pt solid;border-left:gainsboro 0.5pt solid;background-color:whitesmoke;border-top:gainsboro;border-right:gainsboro 0.5pt solid;"&gt;&lt;STRONG&gt;-&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height:12.75pt;"&gt;&lt;TD align="right" class="xl66" height="17" style="border-bottom:gainsboro 0.5pt solid;border-left:gainsboro 0.5pt solid;background-color:white;height:12.75pt;border-top:gainsboro;border-right:gainsboro 0.5pt solid;"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-bottom:gainsboro 0.5pt solid;border-left:gainsboro;background-color:white;border-top:gainsboro;border-right:gainsboro 0.5pt solid;"&gt;1.1&lt;/TD&gt;&lt;TD class="xl66" style="border-bottom:gainsboro 0.5pt solid;border-left:gainsboro;background-color:white;border-top:gainsboro;border-right:gainsboro 0.5pt solid;"&gt;a&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height:12.75pt;"&gt;&lt;TD align="right" class="xl66" height="17" style="border-bottom:gainsboro 0.5pt solid;border-left:gainsboro 0.5pt solid;background-color:white;height:12.75pt;border-top:gainsboro;border-right:gainsboro 0.5pt solid;"&gt;2&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-bottom:gainsboro 0.5pt solid;border-left:gainsboro;background-color:white;border-top:gainsboro;border-right:gainsboro 0.5pt solid;"&gt;2.1&lt;/TD&gt;&lt;TD class="xl66" style="border-bottom:gainsboro 0.5pt solid;border-left:gainsboro;background-color:white;border-top:gainsboro;border-right:gainsboro 0.5pt solid;"&gt;b&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height:12.75pt;"&gt;&lt;TD align="right" class="xl66" height="17" style="border-bottom:gainsboro 0.5pt solid;border-left:gainsboro 0.5pt solid;background-color:white;height:12.75pt;border-top:gainsboro;border-right:gainsboro 0.5pt solid;"&gt;2&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-bottom:gainsboro 0.5pt solid;border-left:gainsboro;background-color:white;border-top:gainsboro;border-right:gainsboro 0.5pt solid;"&gt;2.2&lt;/TD&gt;&lt;TD class="xl66" style="border-bottom:gainsboro 0.5pt solid;border-left:gainsboro;background-color:white;border-top:gainsboro;border-right:gainsboro 0.5pt solid;"&gt;c&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height:12.75pt;"&gt;&lt;TD align="right" class="xl66" height="17" style="border-bottom:gainsboro 0.5pt solid;border-left:gainsboro 0.5pt solid;background-color:white;height:12.75pt;border-top:gainsboro;border-right:gainsboro 0.5pt solid;"&gt;3&lt;/TD&gt;&lt;TD class="xl66" style="border-bottom:gainsboro 0.5pt solid;border-left:gainsboro;background-color:white;border-top:gainsboro;border-right:gainsboro 0.5pt solid;"&gt;-&lt;/TD&gt;&lt;TD class="xl66" style="border-bottom:gainsboro 0.5pt solid;border-left:gainsboro;background-color:white;border-top:gainsboro;border-right:gainsboro 0.5pt solid;"&gt;g&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height:12.75pt;"&gt;&lt;TD align="right" class="xl66" height="17" style="border-bottom:gainsboro 0.5pt solid;border-left:gainsboro 0.5pt solid;background-color:white;height:12.75pt;border-top:gainsboro;border-right:gainsboro 0.5pt solid;"&gt;4&lt;/TD&gt;&lt;TD class="xl66" style="border-bottom:gainsboro 0.5pt solid;border-left:gainsboro;background-color:white;border-top:gainsboro;border-right:gainsboro 0.5pt solid;"&gt;-&lt;/TD&gt;&lt;TD class="xl66" style="border-bottom:gainsboro 0.5pt solid;border-left:gainsboro;background-color:white;border-top:gainsboro;border-right:gainsboro 0.5pt solid;"&gt;h&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height:12.75pt;"&gt;&lt;TD align="right" class="xl66" height="17" style="border-bottom:gainsboro 0.5pt solid;border-left:gainsboro 0.5pt solid;background-color:white;height:12.75pt;border-top:gainsboro;border-right:gainsboro 0.5pt solid;"&gt;5&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-bottom:gainsboro 0.5pt solid;border-left:gainsboro;background-color:white;border-top:gainsboro;border-right:gainsboro 0.5pt solid;"&gt;5.1&lt;/TD&gt;&lt;TD class="xl66" style="border-bottom:gainsboro 0.5pt solid;border-left:gainsboro;background-color:white;border-top:gainsboro;border-right:gainsboro 0.5pt solid;"&gt;d&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height:12.75pt;"&gt;&lt;TD align="right" class="xl66" height="17" style="border-bottom:gainsboro 0.5pt solid;border-left:gainsboro 0.5pt solid;background-color:white;height:12.75pt;border-top:gainsboro;border-right:gainsboro 0.5pt solid;"&gt;5&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-bottom:gainsboro 0.5pt solid;border-left:gainsboro;background-color:white;border-top:gainsboro;border-right:gainsboro 0.5pt solid;"&gt;5.2&lt;/TD&gt;&lt;TD class="xl66" style="border-bottom:gainsboro 0.5pt solid;border-left:gainsboro;background-color:white;border-top:gainsboro;border-right:gainsboro 0.5pt solid;"&gt;e&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;I also had no SQL experience starting out about 2 months ago. I have found it challenging but rewarding. I am still no expert, so I hope my solution works out for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Feb 2011 00:35:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/From-two-tables-create-a-third-table-Consoldiate-keys-and-create/m-p/206800#M62789</guid>
      <dc:creator>mazacini</dc:creator>
      <dc:date>2011-02-09T00:35:47Z</dc:date>
    </item>
    <item>
      <title>From two tables, create a third table. Consoldiate keys and create new column based on a conditional.</title>
      <link>https://community.qlik.com/t5/QlikView/From-two-tables-create-a-third-table-Consoldiate-keys-and-create/m-p/206801#M62790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is A always present in Table1? Is the Key field unique in Table2? Do you only want the "Want" table at the end, and not the other two tables? If so, I think it's as simple as renaming two fields and doing a where not exists(). No need to do any extra work after the fact. Just doing it during the load of these two tables.&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;Want:&lt;BR /&gt;Load&lt;BR /&gt; Key&lt;BR /&gt;,Subkey&lt;BR /&gt;,A as C&lt;BR /&gt;Inline&lt;BR /&gt;[Key, Subkey, A&lt;BR /&gt;1, 1.1, a&lt;BR /&gt;2, 2.1, b&lt;BR /&gt;2, 2.2, c&lt;BR /&gt;5, 5.1, d&lt;BR /&gt;5, 5.2, e];&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;CONCATENATE (Want)&lt;BR /&gt;Load&lt;BR /&gt; Key&lt;BR /&gt;,B as C&lt;BR /&gt;Inline&lt;BR /&gt;[Key, B&lt;BR /&gt;1, f&lt;BR /&gt;3, g&lt;BR /&gt;4, h&lt;BR /&gt;5, i]&lt;BR /&gt;WHERE not exists(Key);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Feb 2011 01:17:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/From-two-tables-create-a-third-table-Consoldiate-keys-and-create/m-p/206801#M62790</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-02-09T01:17:10Z</dc:date>
    </item>
    <item>
      <title>From two tables, create a third table. Consoldiate keys and create new column based on a conditional.</title>
      <link>https://community.qlik.com/t5/QlikView/From-two-tables-create-a-third-table-Consoldiate-keys-and-create/m-p/206802#M62791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi John,&lt;BR /&gt;&lt;BR /&gt;Your assumptions are correct.&lt;BR /&gt;I've tried to implement your suggestion:&lt;BR /&gt;&lt;BR /&gt;Table1:&lt;BR /&gt;LOAD Key, SubKey, A&lt;BR /&gt;FROM Table1.QVD;&lt;BR /&gt;&lt;BR /&gt;Table2:&lt;BR /&gt;LOAD Key, B&lt;BR /&gt;FROM Table2.QVD;&lt;BR /&gt;&lt;BR /&gt;Want:&lt;BR /&gt;Load Key, Subkey, A as C&lt;BR /&gt;Resident Table1;&lt;BR /&gt;&lt;BR /&gt;CONCATENATE (Want)&lt;BR /&gt;Load Key, B as C&lt;BR /&gt;Resident Table2&lt;BR /&gt;WHERE not exists(Key);&lt;BR /&gt;&lt;BR /&gt;Unfortunately, the "Key"s that exist in Table2 but not Table1 are not being populated in "Want". Any ideas?&lt;BR /&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Feb 2011 17:37:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/From-two-tables-create-a-third-table-Consoldiate-keys-and-create/m-p/206802#M62791</guid>
      <dc:creator />
      <dc:date>2011-02-09T17:37:55Z</dc:date>
    </item>
    <item>
      <title>From two tables, create a third table. Consoldiate keys and create new column based on a conditional.</title>
      <link>https://community.qlik.com/t5/QlikView/From-two-tables-create-a-third-table-Consoldiate-keys-and-create/m-p/206803#M62792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't see anything wrong with your script, though I could certainly be missing something. But your script goes to more effort than should be required. Following the pattern I showed above, I'd do this:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;Want:&lt;BR /&gt;LOAD Key, Subkey, A as C&lt;BR /&gt;FROM Table1.QVD;&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;CONCATENATE (Want)&lt;BR /&gt;LOAD Key, B as C&lt;BR /&gt;FROM Table2.QVD&lt;BR /&gt;WHERE not exists(Key);&lt;/P&gt;&lt;P&gt;I'm not loading from QVDs, but that shouldn't matter. The attached example shows the script I wrote before working. The same idea SHOULD work with the QVDs. If it doesn't, I'm not sure what's wrong. From a performance standpoint, both QVD loads should still be optimized, as both renaming and a single exists() are allowed. I'm not 100% sure a not exists() is allowed, though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Feb 2011 02:08:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/From-two-tables-create-a-third-table-Consoldiate-keys-and-create/m-p/206803#M62792</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-02-10T02:08:39Z</dc:date>
    </item>
    <item>
      <title>From two tables, create a third table. Consoldiate keys and create new column based on a conditional.</title>
      <link>https://community.qlik.com/t5/QlikView/From-two-tables-create-a-third-table-Consoldiate-keys-and-create/m-p/206804#M62793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hm, so the script I wrote in the previous post does not seem to work:&lt;BR /&gt;&lt;BR /&gt;Table1:&lt;BR /&gt;LOAD Key, Subkey, A&lt;BR /&gt;Inline&lt;BR /&gt;[Key, Subkey, A&lt;BR /&gt;1, 1.1, a&lt;BR /&gt;2, 2.1, b&lt;BR /&gt;2, 2.2, c&lt;BR /&gt;5, 5.1, d&lt;BR /&gt;5, 5.2, e];&lt;BR /&gt;&lt;BR /&gt;Table2:&lt;BR /&gt;LOAD Key, B&lt;BR /&gt;Inline&lt;BR /&gt;[Key, B&lt;BR /&gt;1, f&lt;BR /&gt;3, g&lt;BR /&gt;4, h&lt;BR /&gt;5, i];&lt;BR /&gt;&lt;BR /&gt;Want:&lt;BR /&gt;Load Key, Subkey, A as C&lt;BR /&gt;Resident Table1;&lt;BR /&gt;&lt;BR /&gt;CONCATENATE (Want)&lt;BR /&gt;Load Key, B as C&lt;BR /&gt;Resident Table2&lt;BR /&gt;WHERE not exists(Key);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The reason (other than the fact I don't know what I'm doing) I make it more complex is because they "Key"s are actually named something different in each table. So I use "as" - perhaps this is the culprit?&lt;BR /&gt;&lt;BR /&gt;The following is more accurate as to what I want to do. I assume the WHERE doesn't cause trouble, but who knows...&lt;BR /&gt;&lt;BR /&gt;Table1:&lt;BR /&gt;LOAD Key1 as Key, SubKey, A&lt;BR /&gt;FROM Table1.QVD&lt;BR /&gt;WHERE A &amp;gt; 0;&lt;BR /&gt;&lt;BR /&gt;Table2:&lt;BR /&gt;LOAD Key2 as Key, B&lt;BR /&gt;FROM Table2.QVD&lt;BR /&gt;WHERE B &amp;gt; 0;&lt;BR /&gt;&lt;BR /&gt;Want:&lt;BR /&gt;Load Key, Subkey, A as C&lt;BR /&gt;Resident Table1;&lt;BR /&gt;&lt;BR /&gt;CONCATENATE (Want)&lt;BR /&gt;Load Key, B as C&lt;BR /&gt;Resident Table2&lt;BR /&gt;WHERE not exists(Key);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for all your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Feb 2011 20:00:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/From-two-tables-create-a-third-table-Consoldiate-keys-and-create/m-p/206804#M62793</guid>
      <dc:creator />
      <dc:date>2011-02-10T20:00:44Z</dc:date>
    </item>
    <item>
      <title>From two tables, create a third table. Consoldiate keys and create new column based on a conditional.</title>
      <link>https://community.qlik.com/t5/QlikView/From-two-tables-create-a-third-table-Consoldiate-keys-and-create/m-p/206805#M62794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Doh! Now I see the problem. Wish I'd seen it sooner. I get bitten by this one now and again.&lt;/P&gt;&lt;P&gt;The problem happens since you load Table2 before you load your Want table. Once you've done that, ALL values of "Key" exist, so the "not exists(Key)" is always false, so you load nothing from Table2.&lt;/P&gt;&lt;P&gt;Needing to rename the key fields as you read them in isn't a problem, but does require a slight syntax change. The below does the trick. Notice the expanded syntax on the exists() statement.&lt;/P&gt;&lt;P&gt;The WHERE conditions on each table won't cause data problems that I can see, but WILL prevent an optimized load, so performance will suffer. I'll set that aside for now, though, as I don't know that you have an actual performance problem, since that wasn't what you were asking about.&lt;/P&gt;&lt;P&gt;Anyway, here's a working new script and attached example:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;Want:&lt;BR /&gt;LOAD&lt;BR /&gt; Key1 as Key&lt;BR /&gt;,Subkey&lt;BR /&gt;,A as C&lt;BR /&gt;INLINE&lt;BR /&gt;[Key1, Subkey, A&lt;BR /&gt;1, 1.1, a&lt;BR /&gt;2, 2.1, b&lt;BR /&gt;2, 2.2, c&lt;BR /&gt;5, 5.1, d&lt;BR /&gt;5, 5.2, e&lt;BR /&gt;6, 6.1,&lt;BR /&gt;]&lt;BR /&gt;WHERE A &amp;gt; '~'&lt;BR /&gt;;&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;CONCATENATE (Want)&lt;BR /&gt;LOAD&lt;BR /&gt; Key2 as Key&lt;BR /&gt;,B as C&lt;BR /&gt;INLINE&lt;BR /&gt;[Key2, B&lt;BR /&gt;1, f&lt;BR /&gt;3, g&lt;BR /&gt;4, h&lt;BR /&gt;5, i&lt;BR /&gt;7,&lt;BR /&gt;]&lt;BR /&gt;WHERE B &amp;gt; '~'&lt;BR /&gt; AND NOT exists(Key,Key2)&lt;BR /&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Feb 2011 20:17:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/From-two-tables-create-a-third-table-Consoldiate-keys-and-create/m-p/206805#M62794</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-02-10T20:17:32Z</dc:date>
    </item>
    <item>
      <title>From two tables, create a third table. Consoldiate keys and create new column based on a conditional.</title>
      <link>https://community.qlik.com/t5/QlikView/From-two-tables-create-a-third-table-Consoldiate-keys-and-create/m-p/206806#M62795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perfect, thank you!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Feb 2011 21:27:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/From-two-tables-create-a-third-table-Consoldiate-keys-and-create/m-p/206806#M62795</guid>
      <dc:creator />
      <dc:date>2011-02-10T21:27:15Z</dc:date>
    </item>
  </channel>
</rss>

