<?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: Advanced Aggr function help in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Advanced-Aggr-function-help/m-p/370413#M492649</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;I also found that to have "PRODUCT" as a dimension it needs including in the AGGR Function, so:&lt;/P&gt;&lt;P&gt;Aggr (xxxxx, CUSTOMER,PRODUCT)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Jun 2012 13:05:01 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-06-27T13:05:01Z</dc:date>
    <item>
      <title>Advanced Aggr function help</title>
      <link>https://community.qlik.com/t5/QlikView/Advanced-Aggr-function-help/m-p/370409#M492645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I have a dataset at the moment which I create in Qlik, then extract to Excel for further calculation. I am sure it can all be done in Qlik, but need assistance to work out how.&lt;/P&gt;&lt;P&gt;PROBLEM DESCRIPTION:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a Base table with the following fields:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="550"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" width="110"&gt;CUSTOMER&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none;" width="110"&gt;PRODUCT&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none;" width="110"&gt;Year&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none;" width="110"&gt;Month&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none;" width="110"&gt;SALES_REVENUE&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I Use a straight Table (dimensions CUSTOMER &amp;amp; PRODUCT) to show which Customers bought in different years:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="WIDTH: 729px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" width="80"&gt;CUSTOMER&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none;" width="80"&gt;PRODUCT&lt;/TD&gt;&lt;TD class="xl65" width="138"&gt;Sales Revenue 2008&lt;/TD&gt;&lt;TD class="xl65" width="153"&gt;2008Flag&lt;/TD&gt;&lt;TD class="xl65" width="126"&gt;Sales Revenue 2009&lt;/TD&gt;&lt;TD class="xl65" width="152"&gt;2009Flag&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="47" style="border-top: medium none;" width="80"&gt;CUSTOMER&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;" width="80"&gt;PRODUCT&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none;" width="138"&gt;SUM({&amp;lt;Year={2008}&amp;gt;}SALES_REVENUE)&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none;" width="153"&gt;IF(SUM({&amp;lt;Year={2008}&amp;gt;}SALES_REVENUE)=0,0,1)&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none;" width="126"&gt;&lt;P&gt;SUM({&amp;lt;Year={2009&amp;gt;}SALES_REVENUE)&lt;/P&gt;&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none;" width="152"&gt;IF(SUM({&amp;lt;Year={2009}&amp;gt;}SALES_REVENUE)=0,0,1)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: medium none;"&gt;A&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none; border-top: medium none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none; border-top: medium none;"&gt;100&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none; border-top: medium none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none; border-top: medium none;"&gt;200&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none; border-top: medium none;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: medium none;"&gt;A&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none; border-top: medium none;"&gt;2&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none; border-top: medium none;"&gt;50&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none; border-top: medium none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none; border-top: medium none;"&gt;0&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none; border-top: medium none;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: medium none;"&gt;B&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none; border-top: medium none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none; border-top: medium none;"&gt;0&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none; border-top: medium none;"&gt;0&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none; border-top: medium none;"&gt;100&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none; border-top: medium none;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: medium none;"&gt;B&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none; border-top: medium none;"&gt;2&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none; border-top: medium none;"&gt;0&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none; border-top: medium none;"&gt;0&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none; border-top: medium none;"&gt;0&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none; border-top: medium none;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: medium none;"&gt;B&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none; border-top: medium none;"&gt;3&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none; border-top: medium none;"&gt;75&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none; border-top: medium none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none; border-top: medium none;"&gt;75&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none; border-top: medium none;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I take the data to Excel and filter the flag columns to show, per product, how much Revenue is from Lost, New or continuing customers ("Customer Base") - without showing the customer as a dimension&lt;/P&gt;&lt;P&gt;(eg Customer A bought Product 2 for $50 in 2008, but $0 in 2009. They are lost customer. Their Revenue from 2008 should show in the "Lost Customers" field below for Product 2.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="WIDTH: 497px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" width="80"&gt;&lt;/TD&gt;&lt;TD class="xl67" width="138"&gt;Sales Revenue&lt;/TD&gt;&lt;TD class="xl68" style="border-left: medium none;" width="153"&gt; &lt;/TD&gt;&lt;TD class="xl69" style="border-left: medium none;" width="126"&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: medium none;"&gt;&lt;/TD&gt;&lt;TD class="xl70" style="border-top: medium none;"&gt;Lost Customers&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none; border-top: medium none;"&gt;Customer Base&lt;/TD&gt;&lt;TD class="xl71" style="border-left: medium none; border-top: medium none;"&gt;New Customers&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl76" height="80" style="border-top: medium none;" width="80"&gt;PRODUCT&lt;/TD&gt;&lt;TD class="xl77" style="border-top: medium none;" width="138"&gt;&lt;P&gt;IF(2008Flag = 1 AND 2009Flag=0), &lt;/P&gt;&lt;P&gt;SUM(Sales Revenue 2008),0)&lt;/P&gt;&lt;/TD&gt;&lt;TD class="xl78" style="border-left: medium none; border-top: medium none;" width="153"&gt;&lt;P&gt;IF(2008Flag = 1 AND 2009Flag=1), &lt;/P&gt;&lt;P&gt;SUM(Sales Revenue 2009),0)&lt;/P&gt;&lt;/TD&gt;&lt;TD class="xl79" style="border-left: medium none; border-top: medium none;" width="126"&gt;&lt;P&gt;IF(2008Flag = 0 AND 2009Flag=1), &lt;/P&gt;&lt;P&gt;SUM(Sales Revenue 2009),0)&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: medium none;"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top: medium none;"&gt;0&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-left: medium none; border-top: medium none;"&gt;200&lt;/TD&gt;&lt;TD align="right" class="xl71" style="border-left: medium none; border-top: medium none;"&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: medium none;"&gt;2&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top: medium none;"&gt;50&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-left: medium none; border-top: medium none;"&gt;0&lt;/TD&gt;&lt;TD align="right" class="xl71" style="border-left: medium none; border-top: medium none;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="21" style="border-top: medium none;"&gt;3&lt;/TD&gt;&lt;TD align="right" class="xl72" style="border-top: medium none;"&gt;0&lt;/TD&gt;&lt;TD align="right" class="xl73" style="border-left: medium none; border-top: medium none;"&gt;75&lt;/TD&gt;&lt;TD align="right" class="xl74" style="border-left: medium none; border-top: medium none;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do the same with a Count of customers to work out how many customers are "Lost", "New" or "Base".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to do all of this as one step in a Straight Table.&lt;/P&gt;&lt;P&gt;If I keep CUSTOMER &amp;amp; PRODUCT as dimensions I can get the data to show correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E.g. Lost Customer Revenue code:&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13407960194751487" jivemacro_uid="_13407960194751487"&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;P&gt;IF&lt;/P&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;SUM&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={2008}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SALES_REVENUE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&amp;gt;0 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;AND&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;SUM&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={2009}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SALES_REVENUE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&amp;lt;=0,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;SUM&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={2008}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SALES_REVENUE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),0) &lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if I remove the CUSTOMER field as a dimension the calculation is a sum of all revenue for 2008 vs 2009, not "per customer".&lt;/P&gt;&lt;P&gt;Therefore I need an "Aggr" function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried:&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13407960194597257" jivemacro_uid="_13407960194597257"&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;IF&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;SUM&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={2008}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SALES_REVENUE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;CUSTOMER&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&amp;gt;0 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;AND&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;SUM&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={2009}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SALES_REVENUE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;CUSTOMER&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&amp;lt;=0,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;SUM&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={2008}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SALES_REVENUE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;CUSTOMER&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),0)&lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also tried:&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13407960194436334" jivemacro_uid="_13407960194436334"&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;P&gt;IF&lt;/P&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;SUM&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Total&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; {&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={2008}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SALES_REVENUE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;CUSTOMER&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&amp;gt;0 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;AND&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;SUM&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Total&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; {&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={2009}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SALES_REVENUE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;CUSTOMER&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&amp;lt;=0,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;SUM&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Total&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; {&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={2008}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SALES_REVENUE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;CUSTOMER&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,0)&lt;/SPAN&gt;&lt;/P&gt; &lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think I need an "Aggr" function around the whole IF statement.&lt;/P&gt;&lt;P&gt;Does anyone have any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jun 2012 11:19:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Advanced-Aggr-function-help/m-p/370409#M492645</guid>
      <dc:creator />
      <dc:date>2012-06-27T11:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced Aggr function help</title>
      <link>https://community.qlik.com/t5/QlikView/Advanced-Aggr-function-help/m-p/370410#M492646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;Try This Expression .for helpful for u&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="jive-code jive-sql"&gt;Sum(Aggr(if(&lt;SPAN class="jive-sql-keyword"&gt;SUM&lt;/SPAN&gt;({&amp;lt;&lt;SPAN class="jive-sql-object"&gt;Year&lt;/SPAN&gt;={2008}&amp;gt;}SALES_REVENUE)&amp;gt;0 &lt;SPAN class="jive-sql-keyword"&gt;AND&lt;/SPAN&gt; &lt;SPAN class="jive-sql-keyword"&gt;SUM&lt;/SPAN&gt;({&amp;lt;&lt;SPAN class="jive-sql-object"&gt;Year&lt;/SPAN&gt;={2009}&amp;gt;}SALES_REVENUE)&amp;lt;=0,&lt;BR /&gt;&lt;SPAN class="jive-sql-keyword"&gt;SUM&lt;/SPAN&gt;({&amp;lt;&lt;SPAN class="jive-sql-object"&gt;Year&lt;/SPAN&gt;={2008}&amp;gt;}SALES_REVENUE)),CUSTOMER))&lt;/CODE&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jun 2012 12:14:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Advanced-Aggr-function-help/m-p/370410#M492646</guid>
      <dc:creator>perumal_41</dc:creator>
      <dc:date>2012-06-27T12:14:46Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced Aggr function help</title>
      <link>https://community.qlik.com/t5/QlikView/Advanced-Aggr-function-help/m-p/370411#M492647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Excellent. This works. Thanks for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jun 2012 12:23:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Advanced-Aggr-function-help/m-p/370411#M492647</guid>
      <dc:creator />
      <dc:date>2012-06-27T12:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced Aggr function help</title>
      <link>https://community.qlik.com/t5/QlikView/Advanced-Aggr-function-help/m-p/370412#M492648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ricki&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This one should work for LOST&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Sum&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUM&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={2008}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SALES_REVENUE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&amp;gt;0 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;AND&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;SUM&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={2009}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SALES_REVENUE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&amp;lt;=0&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;SUM&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={2008}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SALES_REVENUE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,0&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;CUSTOMER&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Remember that the AGGR function is really just a method of building an array of values, so putting multiple AGGR statements together in a single expression really doesn't work because each is evaluated on its own.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Good luck,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Nigel.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jun 2012 12:31:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Advanced-Aggr-function-help/m-p/370412#M492648</guid>
      <dc:creator />
      <dc:date>2012-06-27T12:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced Aggr function help</title>
      <link>https://community.qlik.com/t5/QlikView/Advanced-Aggr-function-help/m-p/370413#M492649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;I also found that to have "PRODUCT" as a dimension it needs including in the AGGR Function, so:&lt;/P&gt;&lt;P&gt;Aggr (xxxxx, CUSTOMER,PRODUCT)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jun 2012 13:05:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Advanced-Aggr-function-help/m-p/370413#M492649</guid>
      <dc:creator />
      <dc:date>2012-06-27T13:05:01Z</dc:date>
    </item>
  </channel>
</rss>

