<?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 Subqueries - script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Subqueries-script/m-p/1756626#M453814</link>
    <description>&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;Can I do this in script?&lt;/P&gt;&lt;P&gt;I do not know how to compare ID in external query to internal ID..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SELECT&lt;/STRONG&gt; proj_st.id, proj.id,ERP_Primary_Key &lt;STRONG&gt;AS&lt;/STRONG&gt; ponumber,NAME &lt;STRONG&gt;AS&lt;/STRONG&gt; action_name,users.nick approver_name,proj_st.status,start_date,end_date,real_end,&lt;/P&gt;&lt;P&gt;po_approvals_decisions.decision, parent&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM&lt;/STRONG&gt; proj &lt;STRONG&gt;JOIN&lt;/STRONG&gt; proj_st &lt;STRONG&gt;ON&lt;/STRONG&gt; proj.id=proj_st.proj_id &lt;STRONG&gt;LEFT&lt;/STRONG&gt; &lt;STRONG&gt;JOIN&lt;/STRONG&gt; users &lt;STRONG&gt;ON&lt;/STRONG&gt; employee_id=users.id&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LEFT&lt;/STRONG&gt; &lt;STRONG&gt;JOIN&lt;/STRONG&gt; po_approvals_decisions &lt;STRONG&gt;ON&lt;/STRONG&gt; proj.id=po_approvals_decisions.poid &lt;STRONG&gt;AND&lt;/STRONG&gt; proj_st.employee_id=po_approvals_decisions.&lt;STRONG&gt;user&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;AND&lt;/STRONG&gt; &lt;STRONG&gt;DATE&lt;/STRONG&gt;(real_end)=&lt;STRONG&gt;DATE&lt;/STRONG&gt;(updatetime)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WHERE&lt;/STRONG&gt; ERP_Primary_Key='8030742' /*M3 PO*/&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;AND&lt;/STRONG&gt; employee_id&amp;gt;100 /*Without system users*/&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;and&lt;/STRONG&gt; proj_st.id &lt;STRONG&gt;in&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;/* get only last approver*/&lt;/P&gt;&lt;P&gt;(&lt;STRONG&gt;select&lt;/STRONG&gt; &lt;STRONG&gt;max&lt;/STRONG&gt;(proj_st2.id) &lt;STRONG&gt;from&lt;/STRONG&gt; proj proj2 &lt;STRONG&gt;JOIN&lt;/STRONG&gt; proj_st proj_st2 &lt;STRONG&gt;ON&lt;/STRONG&gt; proj2.id=proj_st2.proj_id &lt;STRONG&gt;where&lt;/STRONG&gt; proj2.id =proj.id &lt;STRONG&gt;and&lt;/STRONG&gt; employee_id&amp;gt;100)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;and&lt;/STRONG&gt; &lt;STRONG&gt;exists&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;/*get only approved orders*/&lt;/P&gt;&lt;P&gt;(&lt;STRONG&gt;select&lt;/STRONG&gt; 1 &lt;STRONG&gt;from&lt;/STRONG&gt; proj proj2 &lt;STRONG&gt;JOIN&lt;/STRONG&gt; proj_st proj_st2 &lt;STRONG&gt;ON&lt;/STRONG&gt; proj2.id=proj_st2.proj_id &lt;STRONG&gt;where&lt;/STRONG&gt; proj2.id =proj.id &lt;STRONG&gt;and&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;employee_id&amp;lt;=100 &lt;STRONG&gt;and&lt;/STRONG&gt; proj_st2.parent=33 &lt;STRONG&gt;and&lt;/STRONG&gt; proj_st2.status=0 &lt;STRONG&gt;and&lt;/STRONG&gt; proj2.id=proj.id)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Luka&lt;/P&gt;</description>
    <pubDate>Wed, 28 Oct 2020 11:47:55 GMT</pubDate>
    <dc:creator>Luka1615</dc:creator>
    <dc:date>2020-10-28T11:47:55Z</dc:date>
    <item>
      <title>Subqueries - script</title>
      <link>https://community.qlik.com/t5/QlikView/Subqueries-script/m-p/1756626#M453814</link>
      <description>&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;Can I do this in script?&lt;/P&gt;&lt;P&gt;I do not know how to compare ID in external query to internal ID..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SELECT&lt;/STRONG&gt; proj_st.id, proj.id,ERP_Primary_Key &lt;STRONG&gt;AS&lt;/STRONG&gt; ponumber,NAME &lt;STRONG&gt;AS&lt;/STRONG&gt; action_name,users.nick approver_name,proj_st.status,start_date,end_date,real_end,&lt;/P&gt;&lt;P&gt;po_approvals_decisions.decision, parent&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM&lt;/STRONG&gt; proj &lt;STRONG&gt;JOIN&lt;/STRONG&gt; proj_st &lt;STRONG&gt;ON&lt;/STRONG&gt; proj.id=proj_st.proj_id &lt;STRONG&gt;LEFT&lt;/STRONG&gt; &lt;STRONG&gt;JOIN&lt;/STRONG&gt; users &lt;STRONG&gt;ON&lt;/STRONG&gt; employee_id=users.id&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LEFT&lt;/STRONG&gt; &lt;STRONG&gt;JOIN&lt;/STRONG&gt; po_approvals_decisions &lt;STRONG&gt;ON&lt;/STRONG&gt; proj.id=po_approvals_decisions.poid &lt;STRONG&gt;AND&lt;/STRONG&gt; proj_st.employee_id=po_approvals_decisions.&lt;STRONG&gt;user&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;AND&lt;/STRONG&gt; &lt;STRONG&gt;DATE&lt;/STRONG&gt;(real_end)=&lt;STRONG&gt;DATE&lt;/STRONG&gt;(updatetime)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WHERE&lt;/STRONG&gt; ERP_Primary_Key='8030742' /*M3 PO*/&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;AND&lt;/STRONG&gt; employee_id&amp;gt;100 /*Without system users*/&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;and&lt;/STRONG&gt; proj_st.id &lt;STRONG&gt;in&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;/* get only last approver*/&lt;/P&gt;&lt;P&gt;(&lt;STRONG&gt;select&lt;/STRONG&gt; &lt;STRONG&gt;max&lt;/STRONG&gt;(proj_st2.id) &lt;STRONG&gt;from&lt;/STRONG&gt; proj proj2 &lt;STRONG&gt;JOIN&lt;/STRONG&gt; proj_st proj_st2 &lt;STRONG&gt;ON&lt;/STRONG&gt; proj2.id=proj_st2.proj_id &lt;STRONG&gt;where&lt;/STRONG&gt; proj2.id =proj.id &lt;STRONG&gt;and&lt;/STRONG&gt; employee_id&amp;gt;100)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;and&lt;/STRONG&gt; &lt;STRONG&gt;exists&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;/*get only approved orders*/&lt;/P&gt;&lt;P&gt;(&lt;STRONG&gt;select&lt;/STRONG&gt; 1 &lt;STRONG&gt;from&lt;/STRONG&gt; proj proj2 &lt;STRONG&gt;JOIN&lt;/STRONG&gt; proj_st proj_st2 &lt;STRONG&gt;ON&lt;/STRONG&gt; proj2.id=proj_st2.proj_id &lt;STRONG&gt;where&lt;/STRONG&gt; proj2.id =proj.id &lt;STRONG&gt;and&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;employee_id&amp;lt;=100 &lt;STRONG&gt;and&lt;/STRONG&gt; proj_st2.parent=33 &lt;STRONG&gt;and&lt;/STRONG&gt; proj_st2.status=0 &lt;STRONG&gt;and&lt;/STRONG&gt; proj2.id=proj.id)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Luka&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 11:47:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subqueries-script/m-p/1756626#M453814</guid>
      <dc:creator>Luka1615</dc:creator>
      <dc:date>2020-10-28T11:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: Subqueries - script</title>
      <link>https://community.qlik.com/t5/QlikView/Subqueries-script/m-p/1759093#M453930</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/128583"&gt;@Luka1615&lt;/a&gt;&amp;nbsp;Have a look at the following Design Blog post, believe that may point you in the right direction, but I am not sure, you may need to further clarify things if not:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/Preceding-Load/ba-p/1469534" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Design-Blog/Preceding-Load/ba-p/1469534&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you want to search the Design Blog area further, use the following link:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Brett&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2020 20:41:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subqueries-script/m-p/1759093#M453930</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2020-11-05T20:41:47Z</dc:date>
    </item>
  </channel>
</rss>

