<?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 Re: Join two tables based on condition in the second in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Join-two-tables-based-on-condition-in-the-second/m-p/598118#M684297</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why are you limiting to scripts,they might make your model quite complex.&lt;/P&gt;&lt;P&gt;----Load all data from the source&lt;/P&gt;&lt;P&gt;----Append them to the required linking with keys and all that &lt;/P&gt;&lt;P&gt;----now try to produce the same in UI by different objects &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Feb 2014 08:45:30 GMT</pubDate>
    <dc:creator>sujeetsingh</dc:creator>
    <dc:date>2014-02-18T08:45:30Z</dc:date>
    <item>
      <title>Join two tables based on condition in the second</title>
      <link>https://community.qlik.com/t5/QlikView/Join-two-tables-based-on-condition-in-the-second/m-p/598114#M684288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've got two tables &lt;STRONG&gt;Peopletable&lt;/STRONG&gt; and &lt;STRONG&gt;Hourstable&lt;/STRONG&gt; like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Peopletable&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid #000000; width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Project&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Person&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Product&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Role&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Anna&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Car&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Manager&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Anna&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Train&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Consultant&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Johan&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Car&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Consultant&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Johan&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Train&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Consultant&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hourstable&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid #000000; width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Product&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Manager&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Consultant&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Car&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Train&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm now constructing a report where you select a person and then see how many hours that person has accumulated per project. So that selecting "Anna" the output would be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid #000000; width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Project&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Hours&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've got all the formulas working but I haven't found how to merge the tables. In the script I would like to do something like this, but that is not possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_1392711805885175" jivemacro_uid="_1392711805885175"&gt;
&lt;P&gt;Peopletable:&lt;/P&gt;
&lt;P&gt;LOAD&lt;/P&gt;
&lt;P&gt;Project,&lt;/P&gt;
&lt;P&gt;Person,&lt;/P&gt;
&lt;P&gt;Product,&lt;/P&gt;
&lt;P&gt;Role&lt;/P&gt;
&lt;P&gt;FROM X;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Hourstable:&lt;/P&gt;
&lt;P&gt;LOAD&lt;/P&gt;
&lt;P&gt;Product,&lt;/P&gt;
&lt;P&gt;Manager,&lt;/P&gt;
&lt;P&gt;Consultant&lt;/P&gt;
&lt;P&gt;FROM Y;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;LEFT JOIN (Peopletable)&lt;/P&gt;
&lt;P&gt;LOAD&lt;/P&gt;
&lt;P&gt;Product AS Product&lt;/P&gt;
&lt;P&gt;Manager AS Hours&lt;/P&gt;
&lt;P&gt;RESIDENT Hourstable WHERE Role = 'Manager';&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;LEFT JOIN (Peopletable)&lt;/P&gt;
&lt;P&gt;LOAD&lt;/P&gt;
&lt;P&gt;Product AS Product&lt;/P&gt;
&lt;P&gt;Consultant AS Hours&lt;/P&gt;
&lt;P&gt;RESIDENT Hourstable WHERE Role = 'Consultant';&lt;/P&gt;



&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I correctly write this script? Thank you in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Feb 2014 08:21:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-two-tables-based-on-condition-in-the-second/m-p/598114#M684288</guid>
      <dc:creator />
      <dc:date>2014-02-18T08:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: Join two tables based on condition in the second</title>
      <link>https://community.qlik.com/t5/QlikView/Join-two-tables-based-on-condition-in-the-second/m-p/598115#M684290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would use a Crosstable instead of the Joins....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peopletable:&lt;/P&gt;&lt;P&gt;Load ... From X ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Crosstable (Role, Hours, 1)&lt;/P&gt;&lt;P&gt;Load Product, Manager, Consultant From Y ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will get a synthetic key, but this is not a problem (as long as you don't have more tables.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Feb 2014 08:27:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-two-tables-based-on-condition-in-the-second/m-p/598115#M684290</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2014-02-18T08:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: Join two tables based on condition in the second</title>
      <link>https://community.qlik.com/t5/QlikView/Join-two-tables-based-on-condition-in-the-second/m-p/598116#M684292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #f8f8f8;"&gt;can you explain me the -&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #f8f8f8;"&gt;"WHERE Role = 'Consultant'"\&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #f8f8f8;"&gt; WHERE Role = 'Manager'; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #f8f8f8;"&gt;in the &lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #f8f8f8;"&gt;Hourstable there is no column like &lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #f8f8f8;"&gt;Role &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #f8f8f8;"&gt;&lt;SPAN style="color: #000000; font-size: 12px; background-color: #f8f8f8; font-family: Consolas, 'Courier New', Courier, mono, serif;"&gt;i didn't get what you are trying to do....&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Feb 2014 08:34:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-two-tables-based-on-condition-in-the-second/m-p/598116#M684292</guid>
      <dc:creator>adiarnon</dc:creator>
      <dc:date>2014-02-18T08:34:55Z</dc:date>
    </item>
    <item>
      <title>Re: Join two tables based on condition in the second</title>
      <link>https://community.qlik.com/t5/QlikView/Join-two-tables-based-on-condition-in-the-second/m-p/598117#M684295</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;Yes, you could use Crosstable to solve your problem. If you still use JOIN then try as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TmpTable:&lt;/P&gt;&lt;P&gt;Load * from peopletable;&lt;/P&gt;&lt;P&gt;leftjoin&lt;/P&gt;&lt;P&gt;load * from hourstable;&lt;/P&gt;&lt;P&gt;Load *,&lt;/P&gt;&lt;P&gt;if(Role = 'Manager', Manager, Consultant) as Hours&lt;/P&gt;&lt;P&gt;resident TmpTable;&lt;/P&gt;&lt;P&gt;drop table TmpTable;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Feb 2014 08:41:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-two-tables-based-on-condition-in-the-second/m-p/598117#M684295</guid>
      <dc:creator />
      <dc:date>2014-02-18T08:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: Join two tables based on condition in the second</title>
      <link>https://community.qlik.com/t5/QlikView/Join-two-tables-based-on-condition-in-the-second/m-p/598118#M684297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why are you limiting to scripts,they might make your model quite complex.&lt;/P&gt;&lt;P&gt;----Load all data from the source&lt;/P&gt;&lt;P&gt;----Append them to the required linking with keys and all that &lt;/P&gt;&lt;P&gt;----now try to produce the same in UI by different objects &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Feb 2014 08:45:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-two-tables-based-on-condition-in-the-second/m-p/598118#M684297</guid>
      <dc:creator>sujeetsingh</dc:creator>
      <dc:date>2014-02-18T08:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: Join two tables based on condition in the second</title>
      <link>https://community.qlik.com/t5/QlikView/Join-two-tables-based-on-condition-in-the-second/m-p/598119#M684299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would join the data like below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peopletable:&lt;/P&gt;&lt;P&gt;LOAD * Inline [&lt;/P&gt;&lt;P&gt;Project, Person, Product, Role&lt;/P&gt;&lt;P&gt;A, Anna, Car, Manager&lt;/P&gt;&lt;P&gt;B, Anna, Train, Consultant&lt;/P&gt;&lt;P&gt;A, Johan, Car, Consultant&lt;/P&gt;&lt;P&gt;B, Johan, Train, Consultant&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hourstable:&lt;/P&gt;&lt;P&gt;LOAD * Inline [&lt;/P&gt;&lt;P&gt;Product, Manager, Consultant&lt;/P&gt;&lt;P&gt;Car, 1, 3&lt;/P&gt;&lt;P&gt;Train, 4, 7&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Temp:&lt;/P&gt;&lt;P&gt;LOAD Product, 'Manager'&amp;nbsp;&amp;nbsp;&amp;nbsp; as Role, Manager&amp;nbsp;&amp;nbsp;&amp;nbsp; as Hours Resident Hourstable;&lt;/P&gt;&lt;P&gt;LOAD Product, 'Consultant' as Role, Consultant as Hours Resident Hourstable;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;left Join (Peopletable) LOAD * Resident Temp;&lt;/P&gt;&lt;P&gt;DROP Table Temp;&lt;/P&gt;&lt;P&gt;DROP Table Hourstable;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;With this I will have a joined table like below&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Untitled.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/53384_Untitled.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sajeevan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Feb 2014 09:04:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-two-tables-based-on-condition-in-the-second/m-p/598119#M684299</guid>
      <dc:creator />
      <dc:date>2014-02-18T09:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: Join two tables based on condition in the second</title>
      <link>https://community.qlik.com/t5/QlikView/Join-two-tables-based-on-condition-in-the-second/m-p/598120#M684300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You must convert your horizontal HourTable to a vertical versión:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HoursTableTmp:&amp;nbsp; &lt;BR /&gt;LOAD&amp;nbsp; &lt;BR /&gt; Product,&amp;nbsp; &lt;BR /&gt; Manager,&amp;nbsp; &lt;BR /&gt; Consultant&amp;nbsp; &lt;BR /&gt;FROM Y;&amp;nbsp; &lt;/P&gt;&lt;P&gt;HoursTable:&lt;BR /&gt;NoConcatenate LOAD &lt;BR /&gt; Product,&lt;BR /&gt; 'Manager' AS Role,&lt;BR /&gt; Manager AS Hours&lt;BR /&gt;Resident&lt;BR /&gt; HoursTableTmp;&lt;BR /&gt;Concatenate LOAD&lt;BR /&gt; Product,&lt;BR /&gt; 'Consultant' AS Role,&lt;BR /&gt; Consultant AS Hours&lt;BR /&gt;Resident&lt;BR /&gt; HoursTableTmp;&lt;/P&gt;&lt;P&gt;Drop Table HoursTableTmp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Feb 2014 09:07:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-two-tables-based-on-condition-in-the-second/m-p/598120#M684300</guid>
      <dc:creator />
      <dc:date>2014-02-18T09:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: Join two tables based on condition in the second</title>
      <link>https://community.qlik.com/t5/QlikView/Join-two-tables-based-on-condition-in-the-second/m-p/598121#M684301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your suggestion, I went for this albeit a little modified since I had quite a few fields. It seems to work great and no confused data &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Feb 2014 17:28:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-two-tables-based-on-condition-in-the-second/m-p/598121#M684301</guid>
      <dc:creator />
      <dc:date>2014-02-18T17:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: Join two tables based on condition in the second</title>
      <link>https://community.qlik.com/t5/QlikView/Join-two-tables-based-on-condition-in-the-second/m-p/598122#M684302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all for your replies and suggestions!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Feb 2014 17:28:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-two-tables-based-on-condition-in-the-second/m-p/598122#M684302</guid>
      <dc:creator />
      <dc:date>2014-02-18T17:28:30Z</dc:date>
    </item>
  </channel>
</rss>

