<?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: Help with join syntax in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Help-with-join-syntax/m-p/1890535#M73365</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/111148"&gt;@AG-gugelbisolutions&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;...in particular if you have SQL experience...&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Thanx! Indeed, qlik had implemented it somewhat reverse to sql logic. However it is clear to me now, so the fields in the load statement are added to the table in the join statement.&lt;/P&gt;</description>
    <pubDate>Tue, 08 Feb 2022 17:07:57 GMT</pubDate>
    <dc:creator>Intuitive</dc:creator>
    <dc:date>2022-02-08T17:07:57Z</dc:date>
    <item>
      <title>Help with join syntax</title>
      <link>https://community.qlik.com/t5/App-Development/Help-with-join-syntax/m-p/1890393#M73347</link>
      <description>&lt;P&gt;I have two intermediate data step tables that I need to join for the next step&lt;/P&gt;
&lt;P&gt;The data in the previous steps is stored in a loaded&amp;nbsp; table as follows:&lt;/P&gt;
&lt;P&gt;&lt;U&gt;table_a&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;dim_a dim_b dim_c events&lt;/P&gt;
&lt;P&gt;The intermediate tables:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;events_per_dim_c:&lt;BR /&gt;Load &lt;BR /&gt;dim_a,&lt;BR /&gt;dim_b&lt;BR /&gt;sum(events) / count(distinct dim_c) as avg_events_per_dim_c&lt;BR /&gt;Resident table_a&lt;BR /&gt;group by dim_a, dim_b&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;[events_by_dim_c]:&lt;BR /&gt;Load&lt;BR /&gt;dim_a,&lt;BR /&gt;dim_b,&lt;BR /&gt;dim_c&lt;BR /&gt;sum(events) as events_by_dim_c&lt;BR /&gt;resident table_a&lt;BR /&gt;group by dim_a, dim_b, dim_c&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;I tried:&lt;/P&gt;
&lt;P&gt;table_b:&lt;BR /&gt;inner join (events_per_dim_c)&lt;/P&gt;
&lt;P&gt;Load&lt;BR /&gt;avg_events_per_dim_c,&lt;BR /&gt;events_by_dim_c,&lt;BR /&gt;events_by_dim_c/ avg_events_per_dim_cas as events_rel_to_avg&lt;BR /&gt;resident [events_by_dim_c]&lt;/P&gt;
&lt;P&gt;But I get an error, qlik does not recognize the field&amp;nbsp;avg_events_per_dim_c&lt;/P&gt;
&lt;P&gt;(Lets not discuss the use of synthetic keys here:) for now I just need the join to happen&lt;/P&gt;</description>
      <pubDate>Tue, 08 Feb 2022 14:41:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Help-with-join-syntax/m-p/1890393#M73347</guid>
      <dc:creator>Intuitive</dc:creator>
      <dc:date>2022-02-08T14:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: Help with join syntax</title>
      <link>https://community.qlik.com/t5/App-Development/Help-with-join-syntax/m-p/1890424#M73349</link>
      <description>&lt;P&gt;Your join-load loads from &lt;SPAN&gt;events_&lt;STRONG&gt;by&lt;/STRONG&gt;_dim_c but&amp;nbsp;avg_events_per_dim_c comes from another table events_&lt;STRONG&gt;per&lt;/STRONG&gt;_dim_c and therefore you get the load-error.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;- Marcus&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Feb 2022 15:03:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Help-with-join-syntax/m-p/1890424#M73349</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2022-02-08T15:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: Help with join syntax</title>
      <link>https://community.qlik.com/t5/App-Development/Help-with-join-syntax/m-p/1890444#M73352</link>
      <description>&lt;P&gt;Hi there, the reason why you are getting an error is that there is no&amp;nbsp;&lt;SPAN&gt;avg_events_per_dim_c field in&amp;nbsp;events_by_dim_c because you defined it in events_per_dim_c.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If I understand what you are trying to achive, and provided that joining events_by_dim_c&amp;nbsp; and events_per_dim_c by dim_a and dim_b is right, I would try something like this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;INNER JOIN (events_per_dim_c)
LOAD 
	dim_a, // K
	dim_b, // K
	dim_c
	events_by_dim_c
RESIDENT events_by_dim_c;

DROP TABLE events_by_dim_c;

TABLE_B:
Load
	avg_events_per_dim_c,
	events_by_dim_c,
	events_by_dim_c/ avg_events_per_dim_c as as events_rel_to_avg
resident [events_per_dim_c]&lt;/LI-CODE&gt;
&lt;P&gt;It might not be the most efficient piece of code but, at least, I hope it helps you understand.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Feb 2022 15:26:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Help-with-join-syntax/m-p/1890444#M73352</guid>
      <dc:creator>AG-gugelbisolutions</dc:creator>
      <dc:date>2022-02-08T15:26:09Z</dc:date>
    </item>
    <item>
      <title>Re: Help with join syntax</title>
      <link>https://community.qlik.com/t5/App-Development/Help-with-join-syntax/m-p/1890460#M73353</link>
      <description>&lt;P&gt;Could you say more about the join syntax, I read the documentation on qlik site and seems I can't get it right&lt;/P&gt;
&lt;P&gt;my code says&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;inner join (&lt;STRONG&gt;events_per_dim_c&lt;/STRONG&gt;), so I understand that the join loads all the&amp;nbsp;&lt;STRONG&gt;events_per_dim_c &lt;/STRONG&gt;table and then loads the&amp;nbsp;&lt;STRONG&gt;events_by_dim_c&lt;/STRONG&gt; table in the next load expression.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;So I expect the load expression to have access to all the fields from both&amp;nbsp;&lt;STRONG&gt;events_per_dim_c&lt;/STRONG&gt; and&amp;nbsp;&lt;STRONG&gt;events_by_dim_c&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Feb 2022 15:44:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Help-with-join-syntax/m-p/1890460#M73353</guid>
      <dc:creator>Intuitive</dc:creator>
      <dc:date>2022-02-08T15:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: Help with join syntax</title>
      <link>https://community.qlik.com/t5/App-Development/Help-with-join-syntax/m-p/1890508#M73361</link>
      <description>&lt;P&gt;OK, no problem. I know it can be difficult to understand, in particular if you have SQL experience.&lt;/P&gt;
&lt;P&gt;Let me recall the LOAD statement.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;INNER JOIN (events_per_dim_c)
LOAD 
	dim_a, // K
	dim_b, // K
	dim_c
	events_by_dim_c
RESIDENT events_by_dim_c;
&lt;/LI-CODE&gt;
&lt;P&gt;This statement loads four fields from the previously loaded events_by_dim_c table and then (inner) joins the result to&amp;nbsp;events_per_dim_c &lt;U&gt;using the common fields as join key&lt;/U&gt;, in this case dim_a and dim_b. There is no explicit join key definition; you guide the process by loading the right fields or renaming them.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Only after this statement dim_c and events_by_dim_c fields are part of the&amp;nbsp;events_per_dim_c&amp;nbsp; table and you can use them to build TABLE_B.&lt;/P&gt;
&lt;P&gt;Finally, pay attention to the fact that&amp;nbsp;events_by_dim_c still exists unchanged after the statement. This is why I dropped it.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Feb 2022 16:34:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Help-with-join-syntax/m-p/1890508#M73361</guid>
      <dc:creator>AG-gugelbisolutions</dc:creator>
      <dc:date>2022-02-08T16:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: Help with join syntax</title>
      <link>https://community.qlik.com/t5/App-Development/Help-with-join-syntax/m-p/1890535#M73365</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/111148"&gt;@AG-gugelbisolutions&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;...in particular if you have SQL experience...&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Thanx! Indeed, qlik had implemented it somewhat reverse to sql logic. However it is clear to me now, so the fields in the load statement are added to the table in the join statement.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Feb 2022 17:07:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Help-with-join-syntax/m-p/1890535#M73365</guid>
      <dc:creator>Intuitive</dc:creator>
      <dc:date>2022-02-08T17:07:57Z</dc:date>
    </item>
  </channel>
</rss>

