<?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 Creating a connection between two tables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Creating-a-connection-between-two-tables/m-p/1659487#M729834</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have two tables, a Table of "Production output" and a table of "expenses".&lt;/P&gt;&lt;P&gt;the connection between the two tables is the column- Division.&lt;/P&gt;&lt;P&gt;The problem is that in the table&amp;nbsp;"Production output" I have 3 different divisions (Division A+ Division B + Division C). and in the table&amp;nbsp;"expenses" those 3 divisions are displayed as &lt;U&gt;one&lt;/U&gt; division "Division A+B+C".&lt;/P&gt;&lt;P&gt;In order to display the expenses per division, I need to divide the expenses between the 3 divisions according to their output, for Example:&lt;/P&gt;&lt;P&gt;TABLE "Production output"&lt;/P&gt;&lt;P&gt;Division A - 50&lt;/P&gt;&lt;P&gt;Division B - 100&lt;/P&gt;&lt;P&gt;Division C - 50&lt;/P&gt;&lt;P&gt;Division&amp;nbsp; E - 100&lt;/P&gt;&lt;P&gt;***Total output of division A+B+C=200***&lt;/P&gt;&lt;P&gt;TABLE "expenses"&lt;/P&gt;&lt;P&gt;DIVISION A+B+C - 1000&lt;/P&gt;&lt;P&gt;DIVISION E - 300&lt;/P&gt;&lt;P&gt;what I want to display is, expenses by division:&lt;/P&gt;&lt;P&gt;Division A&amp;nbsp; - 250 ***(50/200)*1000***&lt;/P&gt;&lt;P&gt;Division B - 500*** (100/200)*1000***&lt;/P&gt;&lt;P&gt;Division C - 250 ***(50/200)*1000***&lt;/P&gt;&lt;P&gt;Division E - 300&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to create a connection between those two tables in this way? so when users select division "A+B+C",&lt;/P&gt;&lt;P&gt;he will get the display as above?&lt;/P&gt;&lt;P&gt;and Is it possible to create this calculation in the script only?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 01:39:32 GMT</pubDate>
    <dc:creator>bellesol</dc:creator>
    <dc:date>2024-11-16T01:39:32Z</dc:date>
    <item>
      <title>Creating a connection between two tables</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-connection-between-two-tables/m-p/1659487#M729834</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have two tables, a Table of "Production output" and a table of "expenses".&lt;/P&gt;&lt;P&gt;the connection between the two tables is the column- Division.&lt;/P&gt;&lt;P&gt;The problem is that in the table&amp;nbsp;"Production output" I have 3 different divisions (Division A+ Division B + Division C). and in the table&amp;nbsp;"expenses" those 3 divisions are displayed as &lt;U&gt;one&lt;/U&gt; division "Division A+B+C".&lt;/P&gt;&lt;P&gt;In order to display the expenses per division, I need to divide the expenses between the 3 divisions according to their output, for Example:&lt;/P&gt;&lt;P&gt;TABLE "Production output"&lt;/P&gt;&lt;P&gt;Division A - 50&lt;/P&gt;&lt;P&gt;Division B - 100&lt;/P&gt;&lt;P&gt;Division C - 50&lt;/P&gt;&lt;P&gt;Division&amp;nbsp; E - 100&lt;/P&gt;&lt;P&gt;***Total output of division A+B+C=200***&lt;/P&gt;&lt;P&gt;TABLE "expenses"&lt;/P&gt;&lt;P&gt;DIVISION A+B+C - 1000&lt;/P&gt;&lt;P&gt;DIVISION E - 300&lt;/P&gt;&lt;P&gt;what I want to display is, expenses by division:&lt;/P&gt;&lt;P&gt;Division A&amp;nbsp; - 250 ***(50/200)*1000***&lt;/P&gt;&lt;P&gt;Division B - 500*** (100/200)*1000***&lt;/P&gt;&lt;P&gt;Division C - 250 ***(50/200)*1000***&lt;/P&gt;&lt;P&gt;Division E - 300&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to create a connection between those two tables in this way? so when users select division "A+B+C",&lt;/P&gt;&lt;P&gt;he will get the display as above?&lt;/P&gt;&lt;P&gt;and Is it possible to create this calculation in the script only?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 01:39:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-connection-between-two-tables/m-p/1659487#M729834</guid>
      <dc:creator>bellesol</dc:creator>
      <dc:date>2024-11-16T01:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a connection between two tables</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-connection-between-two-tables/m-p/1659944#M729835</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I made a long script to make the logic clear, otherwise there's a lot of optimization you can do.&lt;/P&gt;&lt;P&gt;but the principle is that you always have "+" in the table TABLE "expenses" no for example A+B-D&lt;/P&gt;&lt;P&gt;the result obtained&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 512px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/25892i4DF44E6F9E827AE9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;attached the qlikview file as also&lt;/P&gt;&lt;LI-CODE lang="python"&gt;input1:

load * inline [
Division,production
Division A,50
Division B,100
Division C,50
Division E,100
];

input2:

load RowNo() as key,* inline[
Divisions,expenses
Division A+B+C, 1000
Division E, 300
];


temps1:
NoConcatenate
LOAD trim(PurgeChar(Division,'Division')) as Division,production resident input1;

temps2:
NoConcatenate
load trim(PurgeChar(Divisions,'Division')) as Divisions,expenses,key resident input2;

DROP table input1,input2;


temps3:
NoConcatenate
load trim(SubField(Divisions,'+')) as Division,expenses,key resident temps2;

DROP table temps2;

output:
NoConcatenate
load * Resident temps1;
left join 
load * Resident temps3;

DROP table temps1,temps3;

output2:
NoConcatenate

load 
key,
sum(production) as somme

resident output
group by key;
Right join
LOAD *
resident output;
drop table output;


Final:
NoConcatenate
load
Division,
(production/somme)*expenses as result
Resident output2;

DROP table output2;&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 21 Dec 2019 17:09:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-connection-between-two-tables/m-p/1659944#M729835</guid>
      <dc:creator>Taoufiq_Zarra</dc:creator>
      <dc:date>2019-12-21T17:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a connection between two tables</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-connection-between-two-tables/m-p/1659967#M729836</link>
      <description>&lt;P&gt;WOW! THANK YOU SO MUCH!&lt;/P&gt;&lt;P&gt;I couldn't ask for a better answer!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_heart_eyes:"&gt;😍&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 22 Dec 2019 11:00:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-connection-between-two-tables/m-p/1659967#M729836</guid>
      <dc:creator>bellesol</dc:creator>
      <dc:date>2019-12-22T11:00:53Z</dc:date>
    </item>
  </channel>
</rss>

