<?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 and do average function - SQL query provided in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Join-two-tables-and-do-average-function-SQL-query-provided/m-p/1676841#M728470</link>
    <description>&lt;P&gt;Thanks this worked. I didn't know how to do this just using the table but now i know &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Feb 2020 21:30:13 GMT</pubDate>
    <dc:creator>Shifonjer</dc:creator>
    <dc:date>2020-02-18T21:30:13Z</dc:date>
    <item>
      <title>Join two tables and do average function - SQL query provided</title>
      <link>https://community.qlik.com/t5/QlikView/Join-two-tables-and-do-average-function-SQL-query-provided/m-p/1676431#M728468</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I am loading two tables from excel file (both are in same file just different sheet) like this :&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;LOAD BI,&lt;BR /&gt;Subject,&lt;BR /&gt;Grade&lt;BR /&gt;FROM&lt;BR /&gt;[Some_Excel.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is Ispiti);&lt;/P&gt;&lt;P&gt;Table2:&lt;/P&gt;&lt;P&gt;LOAD BI,&lt;BR /&gt;Name,&lt;BR /&gt;LastName,&lt;BR /&gt;Address,&lt;BR /&gt;City&lt;BR /&gt;FROM&lt;BR /&gt;[Some_Excel.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is Studenti);&lt;/P&gt;&lt;P&gt;What i want to do is same as this SQL Query&amp;nbsp;&lt;/P&gt;&lt;P&gt;Select City, AVG(Grade) as Average_Grade&lt;BR /&gt;from Table2&lt;BR /&gt;Join Table1 on Table1.BI = Table2.BI&lt;BR /&gt;Group By City&lt;BR /&gt;Oredr By Average_Grade;&lt;/P&gt;&lt;P&gt;Could anyone help me with this&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-two-tables-and-do-average-function-SQL-query-provided/m-p/1676431#M728468</guid>
      <dc:creator>Shifonjer</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Join two tables and do average function - SQL query provided</title>
      <link>https://community.qlik.com/t5/QlikView/Join-two-tables-and-do-average-function-SQL-query-provided/m-p/1676432#M728469</link>
      <description>&lt;P&gt;If you determined to replicate a SQL like scenario for whatever reason you could go about it like this:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Table1_temp:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;LOAD&lt;/SPAN&gt;&lt;SPAN&gt; BI&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Subject&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Grade&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FROM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;[Some_Excel.xlsx]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;(ooxml&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt; embedded labels&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt; table is Ispiti)&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt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AN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;from&lt;/SPAN&gt;&lt;SPAN&gt; table1_temp&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Group By&lt;/SPAN&gt;&lt;SPAN&gt; City&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Order By&lt;/SPAN&gt;&lt;SPAN&gt; Average_Grade&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;drop&lt;/SPAN&gt; &lt;SPAN&gt;table&lt;/SPAN&gt;&lt;SPAN&gt; Table1_temp&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Depending on what you are trying to achieve however this may be totally unnecessary.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;If what you want to get is a table or chart with the Avg Grade by city(or subject, or LastName etc) then all you need to do is load the two tables and Qlik Sense will automatically associate them on the BI field. This is the beauty of association, you don't need to define any joins etc and you won't be limiting the data you load as happens with SQL's set based logic. Then all you need to do is add a table object onto your sheet, add city as a dimension and then add avg(Grade) as a measure and you'll have the table you were trying to create.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Hope that's useful.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Rod&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 18 Feb 2020 01:53:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-two-tables-and-do-average-function-SQL-query-provided/m-p/1676432#M728469</guid>
      <dc:creator>Rodj</dc:creator>
      <dc:date>2020-02-18T01:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: Join two tables and do average function - SQL query provided</title>
      <link>https://community.qlik.com/t5/QlikView/Join-two-tables-and-do-average-function-SQL-query-provided/m-p/1676841#M728470</link>
      <description>&lt;P&gt;Thanks this worked. I didn't know how to do this just using the table but now i know &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2020 21:30:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-two-tables-and-do-average-function-SQL-query-provided/m-p/1676841#M728470</guid>
      <dc:creator>Shifonjer</dc:creator>
      <dc:date>2020-02-18T21:30:13Z</dc:date>
    </item>
    <item>
      <title>Re: Join two tables and do average function - SQL query provided</title>
      <link>https://community.qlik.com/t5/QlikView/Join-two-tables-and-do-average-function-SQL-query-provided/m-p/1676843#M728471</link>
      <description>&lt;P&gt;Excellent! I wasn't quite sure of your reason for trying to do what you asked so I tried to cover both bases.&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Rod&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2020 21:34:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-two-tables-and-do-average-function-SQL-query-provided/m-p/1676843#M728471</guid>
      <dc:creator>Rodj</dc:creator>
      <dc:date>2020-02-18T21:34:42Z</dc:date>
    </item>
  </channel>
</rss>

