<?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 use sub-queries in qlikview scipting in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-use-sub-queries-in-qlikview-scipting/m-p/794471#M1040076</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use QlikView functions in order to achieve it. For instance, having the following SQL Statement in a traditional applcation&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT department_name, employee_name, count(*) as numberOfEmployees&amp;nbsp; FROM EMPLOYEE where EMPLOYEE.ID_DEPARTMENT = DEPARTMENT.ID_DEPARTMENT AND DEPARTMENT.ID_DEPARTMENT IN (SELECT ID_DEPARTMENT FROM REGION WHERE ID_REGION="NORTH") group by department_name;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In QlikView , forget abut the latter statetement &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; , it is very easy, since QView in the majority of its objects aggregates automatically. For instance,&amp;nbsp; &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; the result in a straight chart table would be:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;1) Add the following as Dimensions&lt;/P&gt;&lt;P&gt;department_name, employee_name&lt;/P&gt;&lt;P&gt;and then&lt;/P&gt;&lt;P&gt;2) Add the following Expression and label it as numberOfEmployees &lt;/P&gt;&lt;P&gt;IF (ID_REGION = 'NORTH',COUNT(employee_name),0)&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;IF (MATCH(ID_REGION , 'NORTH'),COUNT(employee_name),0)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 28 Dec 2014 16:19:06 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-12-28T16:19:06Z</dc:date>
    <item>
      <title>How to use sub-queries in qlikview scipting</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-sub-queries-in-qlikview-scipting/m-p/794467#M1040072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How to use sub-queries in qlikview scripting?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please explain, thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Dec 2014 11:11:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-sub-queries-in-qlikview-scipting/m-p/794467#M1040072</guid>
      <dc:creator />
      <dc:date>2014-12-28T11:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to use sub-queries in qlikview scipting</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-sub-queries-in-qlikview-scipting/m-p/794468#M1040073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Qlikview does not know sub-queries. If you create a select statement in the Qlikview script (or any sql statement preceded by the SQL keyword) then that statement is not processed by Qlikview, but send to the database server for execution. That means you can (in fact must) use the SQL dialect your database server understands. If your database server can handle sub-queries then you can use them in the sql statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Dec 2014 11:47:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-sub-queries-in-qlikview-scipting/m-p/794468#M1040073</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-12-28T11:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to use sub-queries in qlikview scipting</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-sub-queries-in-qlikview-scipting/m-p/794469#M1040074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/2972"&gt;Preceding Load&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load Fld1,Max(Fld2) Group by Fld1; //Preceding load&lt;/P&gt;&lt;P&gt;Load * Inline [&lt;/P&gt;&lt;P&gt;Fld1,Fld2&lt;/P&gt;&lt;P&gt;1,100&lt;/P&gt;&lt;P&gt;1,200&lt;/P&gt;&lt;P&gt;2,50&lt;/P&gt;&lt;P&gt;2,150 ];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Dec 2014 12:59:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-sub-queries-in-qlikview-scipting/m-p/794469#M1040074</guid>
      <dc:creator>anbu1984</dc:creator>
      <dc:date>2014-12-28T12:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to use sub-queries in qlikview scipting</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-sub-queries-in-qlikview-scipting/m-p/794470#M1040075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can not use Sub Queries into qlikview like which is SQL, but you can use resident table or any other table load and then use Joins ( inner, left , right ) and make single table out of that tables bu conditions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anand&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Dec 2014 13:03:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-sub-queries-in-qlikview-scipting/m-p/794470#M1040075</guid>
      <dc:creator>its_anandrjs</dc:creator>
      <dc:date>2014-12-28T13:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to use sub-queries in qlikview scipting</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-sub-queries-in-qlikview-scipting/m-p/794471#M1040076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use QlikView functions in order to achieve it. For instance, having the following SQL Statement in a traditional applcation&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT department_name, employee_name, count(*) as numberOfEmployees&amp;nbsp; FROM EMPLOYEE where EMPLOYEE.ID_DEPARTMENT = DEPARTMENT.ID_DEPARTMENT AND DEPARTMENT.ID_DEPARTMENT IN (SELECT ID_DEPARTMENT FROM REGION WHERE ID_REGION="NORTH") group by department_name;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In QlikView , forget abut the latter statetement &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; , it is very easy, since QView in the majority of its objects aggregates automatically. For instance,&amp;nbsp; &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; the result in a straight chart table would be:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;1) Add the following as Dimensions&lt;/P&gt;&lt;P&gt;department_name, employee_name&lt;/P&gt;&lt;P&gt;and then&lt;/P&gt;&lt;P&gt;2) Add the following Expression and label it as numberOfEmployees &lt;/P&gt;&lt;P&gt;IF (ID_REGION = 'NORTH',COUNT(employee_name),0)&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;IF (MATCH(ID_REGION , 'NORTH'),COUNT(employee_name),0)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Dec 2014 16:19:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-sub-queries-in-qlikview-scipting/m-p/794471#M1040076</guid>
      <dc:creator />
      <dc:date>2014-12-28T16:19:06Z</dc:date>
    </item>
  </channel>
</rss>

