<?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 Aggr Expression with nested IF in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggr-Expression-with-nested-IF/m-p/29467#M4903</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings,&amp;nbsp; I am looking for comments regarding this usage of Aggr.&amp;nbsp; This expression is being used with QuickBooks Advanced Reporting.&amp;nbsp; The goal is to list open sales orders.&amp;nbsp; &lt;SPAN style="font-size: 10pt;"&gt;I am unable to modify the load script.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;The sales order, &lt;SPAN style="font-size: 13.3333px;"&gt;[Transactions&lt;/SPAN&gt;.Ref&lt;SPAN style="font-size: 13.3333px;"&gt; Number],&lt;/SPAN&gt; has both header and line level records.&amp;nbsp; If the header record fields, &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;[Transactions.Fully Invoiced] or &lt;SPAN style="font-size: 13.3333px;"&gt;[Transactions.Manually Closed] =0, then sum &lt;SPAN style="font-size: 13.3333px;"&gt;[Transactions.Amount] &lt;/SPAN&gt;for the &lt;SPAN style="font-size: 13.3333px;"&gt;[Transactions.Ref Number] when the line is not &lt;SPAN style="font-size: 13.3333px;"&gt;[Transactions.Manually Closed]&lt;/SPAN&gt;. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This expression is working, but I am not confident this is a proper usage of Aggr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="p1"&gt;=if(aggr(sum({&amp;lt;[Transactions.Txn Type]={'Sales Order'}&amp;gt;}[Transactions.Fully Invoiced]),[Transactions.Ref Number],[Transactions.Txn Type])=0,&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp; if(aggr(sum({&amp;lt;[Transactions.Txn Type]={'Sales Order'},[Transactions.Header Or Line]={'Header'}&amp;gt;}[Transactions.Manually Closed]),[Transactions.Ref Number],[Transactions.Txn Type])=0,&lt;/P&gt;&lt;P class="p1"&gt;sum(&lt;/P&gt;&lt;P class="p1"&gt;{&amp;lt;[Transactions.Txn Type]={'Sales Order'},[Transactions.Manually Closed]={0},[Transactions.Header Or Line]={'Line'}&amp;gt;}&lt;/P&gt;&lt;P class="p1"&gt;[Transactions.Amount]&lt;/P&gt;&lt;P class="p1"&gt;)&lt;/P&gt;&lt;P class="p1"&gt;))&lt;/P&gt;&lt;P class="p1"&gt;&lt;/P&gt;&lt;P class="p1"&gt;Thank you for your comment.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Jun 2018 19:30:16 GMT</pubDate>
    <dc:creator>donaniii</dc:creator>
    <dc:date>2018-06-14T19:30:16Z</dc:date>
    <item>
      <title>Aggr Expression with nested IF</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-Expression-with-nested-IF/m-p/29467#M4903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings,&amp;nbsp; I am looking for comments regarding this usage of Aggr.&amp;nbsp; This expression is being used with QuickBooks Advanced Reporting.&amp;nbsp; The goal is to list open sales orders.&amp;nbsp; &lt;SPAN style="font-size: 10pt;"&gt;I am unable to modify the load script.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;The sales order, &lt;SPAN style="font-size: 13.3333px;"&gt;[Transactions&lt;/SPAN&gt;.Ref&lt;SPAN style="font-size: 13.3333px;"&gt; Number],&lt;/SPAN&gt; has both header and line level records.&amp;nbsp; If the header record fields, &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;[Transactions.Fully Invoiced] or &lt;SPAN style="font-size: 13.3333px;"&gt;[Transactions.Manually Closed] =0, then sum &lt;SPAN style="font-size: 13.3333px;"&gt;[Transactions.Amount] &lt;/SPAN&gt;for the &lt;SPAN style="font-size: 13.3333px;"&gt;[Transactions.Ref Number] when the line is not &lt;SPAN style="font-size: 13.3333px;"&gt;[Transactions.Manually Closed]&lt;/SPAN&gt;. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This expression is working, but I am not confident this is a proper usage of Aggr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="p1"&gt;=if(aggr(sum({&amp;lt;[Transactions.Txn Type]={'Sales Order'}&amp;gt;}[Transactions.Fully Invoiced]),[Transactions.Ref Number],[Transactions.Txn Type])=0,&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp; if(aggr(sum({&amp;lt;[Transactions.Txn Type]={'Sales Order'},[Transactions.Header Or Line]={'Header'}&amp;gt;}[Transactions.Manually Closed]),[Transactions.Ref Number],[Transactions.Txn Type])=0,&lt;/P&gt;&lt;P class="p1"&gt;sum(&lt;/P&gt;&lt;P class="p1"&gt;{&amp;lt;[Transactions.Txn Type]={'Sales Order'},[Transactions.Manually Closed]={0},[Transactions.Header Or Line]={'Line'}&amp;gt;}&lt;/P&gt;&lt;P class="p1"&gt;[Transactions.Amount]&lt;/P&gt;&lt;P class="p1"&gt;)&lt;/P&gt;&lt;P class="p1"&gt;))&lt;/P&gt;&lt;P class="p1"&gt;&lt;/P&gt;&lt;P class="p1"&gt;Thank you for your comment.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2018 19:30:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-Expression-with-nested-IF/m-p/29467#M4903</guid>
      <dc:creator>donaniii</dc:creator>
      <dc:date>2018-06-14T19:30:16Z</dc:date>
    </item>
  </channel>
</rss>

