<?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: How to Create a New Table From Two Different Tables? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-Create-a-New-Table-From-Two-Different-Tables/m-p/585099#M1112244</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you don't want to change the script perhaps with a sum if&lt;/P&gt;&lt;P&gt;sum(if([Prod_Name]=Name, Quantity / Price))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;better to change the script, just rename Prod_Name in Table2 to Name&amp;nbsp; (Prod_Name as Name) &lt;/P&gt;&lt;P&gt;to associate products at the db level&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Mar 2014 23:00:55 GMT</pubDate>
    <dc:creator>maxgro</dc:creator>
    <dc:date>2014-03-17T23:00:55Z</dc:date>
    <item>
      <title>How to Create a New Table From Two Different Tables?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-Create-a-New-Table-From-Two-Different-Tables/m-p/585097#M1112242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG alt="qvimage.PNG.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/55192_qvimage.PNG.png" style="width: 620px; height: 146px;" /&gt;&lt;/P&gt;&lt;P&gt;I have two tables, Table 1 and Table 2 (see above).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Table 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dimension: Name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Expression: Sum(Quantity)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Table 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dimension: Prod_Name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Expression: Sum(Price)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The value inside "Name" and "Prod_Name" are the same; however they are from different tables and have different field name (thus I cannot use the Expression "Sum(Quantity)/Sum(Price)" to calculate the average price).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to create the result table based on the data from the previose two tables?&lt;/P&gt;&lt;P&gt;I tried to use AGGR to create a vitual table, but I don't know how to match the value from Table 2 to Table 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Any help would be greatly appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2014 21:57:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-Create-a-New-Table-From-Two-Different-Tables/m-p/585097#M1112242</guid>
      <dc:creator />
      <dc:date>2014-03-17T21:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to Create a New Table From Two Different Tables?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-Create-a-New-Table-From-Two-Different-Tables/m-p/585098#M1112243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First, join the two fact tables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table1_tmp:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Name&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Sum(Quantity) AS Quantity&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;FROM &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Table_1_Source&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Your data source&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;GROUP BY Name;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table2_tmp:&lt;/P&gt;&lt;P&gt;LEFT JOIN&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Prod_Name&lt;/SPAN&gt; AS Name,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(Price) AS Price&lt;/P&gt;&lt;P&gt;FROM &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Table_2_Source&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt; //Your data source&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;GROUP BY &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Prod_Name&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Then, use a Resident sentence to calculate the average:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Result:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;LOAD *,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Quantity/Price AS Average&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt; line-height: 1.5em;"&gt;Resident &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Table1_tmp&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt; line-height: 1.5em;"&gt;Drop Table1_tmp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt; line-height: 1.5em;"&gt;I have not Qlikview at hand, but I think it should work... &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt; line-height: 1.5em;"&gt;Regards!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2014 22:19:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-Create-a-New-Table-From-Two-Different-Tables/m-p/585098#M1112243</guid>
      <dc:creator>julian_rodriguez</dc:creator>
      <dc:date>2014-03-17T22:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to Create a New Table From Two Different Tables?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-Create-a-New-Table-From-Two-Different-Tables/m-p/585099#M1112244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you don't want to change the script perhaps with a sum if&lt;/P&gt;&lt;P&gt;sum(if([Prod_Name]=Name, Quantity / Price))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;better to change the script, just rename Prod_Name in Table2 to Name&amp;nbsp; (Prod_Name as Name) &lt;/P&gt;&lt;P&gt;to associate products at the db level&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2014 23:00:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-Create-a-New-Table-From-Two-Different-Tables/m-p/585099#M1112244</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2014-03-17T23:00:55Z</dc:date>
    </item>
  </channel>
</rss>

