<?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 resident tables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Join-two-resident-tables/m-p/470561#M175786</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can join resident tables just like any other tables with the syntax left / right join ()... from ....;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your case one option would be to left join just the valuegross field in&amp;nbsp; the Stock table to the data table, just before the KPI2 load.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EG&lt;/P&gt;&lt;P&gt;left join (data) &lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;ControlDate, &lt;/P&gt;&lt;P&gt;Valuegross &lt;/P&gt;&lt;P&gt;resident stock;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load 2 as kpi....&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;resident data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you needed to keep the table then you could drop the field from it after the KPI 2 to avoid comlicated keys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop field valuegross from data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do let me know if this works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Dec 2012 23:19:02 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-12-28T23:19:02Z</dc:date>
    <item>
      <title>Join two resident tables</title>
      <link>https://community.qlik.com/t5/QlikView/Join-two-resident-tables/m-p/470559#M175784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the code I had written in the load script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.KPI works perfectly fine as Ward, Net_cost are both the fields in the file&amp;nbsp; DATA therefore I used Resident function.&lt;/P&gt;&lt;P&gt;3.KPI works perfectly fine as Site_data , Supcode_data , Ward , Net_cost all exist in the file DATA therefore I used Resident function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is with 2.KPI as Ward is in the file DATA and Valuegross is in the file called STOCK. I am assuming that i should combine the resident function that includes DATA and STOCK. Unable to figure out the expression and dont know if there is a different way of approach. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD 1 As KPI,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MonthStart(ControlDate) As ControlDate,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(If(Ward = 'EX',Net_cost)) As Numerator,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 As Denominator&lt;/P&gt;&lt;P&gt;Resident [data]&lt;BR /&gt;GROUP BY MonthStart(ControlDate);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Concatenate&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;LOAD 2 As KPI,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MonthStart(ControlDate) As ControlDate,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(If&lt;/STRONG&gt;&lt;SPAN style="color: #800000;"&gt;(&lt;STRONG&gt;Ward&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;STRONG&gt;= 'EX',Net_cost)) As Numerator, &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; Sum(&lt;SPAN style="color: #ff6600;"&gt;Valuegross)&lt;/SPAN&gt;as Denominator&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;GROUP BY MonthStart(ControlDate);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resident [data]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Concatenate &lt;BR /&gt;LOAD 3 As KPI,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MonthStart(ControlDate) As ControlDate,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(If(Site_data = '431' and Supcode_data = 'NSPS' and Ward = 'EX',Net_cost)) as Numerator, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(If(Site_data = '431' and Ward = 'EX', Net_cost)) as Denominator&lt;/P&gt;&lt;P&gt;Resident [data]&lt;BR /&gt;GROUP BY MonthStart(ControlDate);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;KV&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Dec 2012 14:51:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-two-resident-tables/m-p/470559#M175784</guid>
      <dc:creator />
      <dc:date>2012-12-28T14:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: Join two resident tables</title>
      <link>https://community.qlik.com/t5/QlikView/Join-two-resident-tables/m-p/470560#M175785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Resident looks up in a table you load previously and only in that table, not in files.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Dec 2012 17:32:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-two-resident-tables/m-p/470560#M175785</guid>
      <dc:creator>chematos</dc:creator>
      <dc:date>2012-12-28T17:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: Join two resident tables</title>
      <link>https://community.qlik.com/t5/QlikView/Join-two-resident-tables/m-p/470561#M175786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can join resident tables just like any other tables with the syntax left / right join ()... from ....;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your case one option would be to left join just the valuegross field in&amp;nbsp; the Stock table to the data table, just before the KPI2 load.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EG&lt;/P&gt;&lt;P&gt;left join (data) &lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;ControlDate, &lt;/P&gt;&lt;P&gt;Valuegross &lt;/P&gt;&lt;P&gt;resident stock;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load 2 as kpi....&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;resident data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you needed to keep the table then you could drop the field from it after the KPI 2 to avoid comlicated keys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop field valuegross from data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do let me know if this works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Dec 2012 23:19:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-two-resident-tables/m-p/470561#M175786</guid>
      <dc:creator />
      <dc:date>2012-12-28T23:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: Join two resident tables</title>
      <link>https://community.qlik.com/t5/QlikView/Join-two-resident-tables/m-p/470562#M175787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry for the late reply. It works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks Erica. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jan 2013 11:51:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-two-resident-tables/m-p/470562#M175787</guid>
      <dc:creator />
      <dc:date>2013-01-21T11:51:23Z</dc:date>
    </item>
  </channel>
</rss>

