<?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 function problem in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggr-function-problem/m-p/859515#M655056</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having trouble with the following expression, because it is returning zero and it shouldn't:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum(aggr( (&lt;/P&gt;&lt;P&gt;(sum( { &amp;lt; &lt;SPAN style="font-size: 13.3333330154419px;"&gt;myYear=,myMonth=,myDay=, [End Date]&lt;/SPAN&gt;=$(=vDataSel_min),&lt;SPAN style="font-size: 13.3333330154419px;"&gt;[myDate]&lt;/SPAN&gt;=$(=vDateSel) &amp;gt; } &lt;SPAN style="font-size: 13.3333330154419px;"&gt;[End Date] &lt;/SPAN&gt;) )&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;(min( {$} TOTAL&lt;/P&gt;&lt;P&gt;([myDate])))),[ID]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My idea is to subtract the minimum of the selected date to the EndDate for each ID. Each ID has its own EndDate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have already the following similar expression and it is working fine:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;=sum(aggr((&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;max({$} TOTAL&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;([myDate])+1)&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;)&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;- (sum({&amp;lt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;myYear=,myMonth=,myDay=, &lt;/SPAN&gt;[myDate]=$(=vDateSel),[End Date]=$(=vDataSel_max)&amp;gt;}&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;([myDate]))),[ID]))&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;I don't understand why it is working for the second one and it is not working for the first one. There are no errors in the defined variables, I am using all of them in other objects. &lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Thanks in advance, &lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Inês&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 19 Jun 2015 10:29:16 GMT</pubDate>
    <dc:creator>inescastelhano</dc:creator>
    <dc:date>2015-06-19T10:29:16Z</dc:date>
    <item>
      <title>Aggr function problem</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function-problem/m-p/859515#M655056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having trouble with the following expression, because it is returning zero and it shouldn't:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum(aggr( (&lt;/P&gt;&lt;P&gt;(sum( { &amp;lt; &lt;SPAN style="font-size: 13.3333330154419px;"&gt;myYear=,myMonth=,myDay=, [End Date]&lt;/SPAN&gt;=$(=vDataSel_min),&lt;SPAN style="font-size: 13.3333330154419px;"&gt;[myDate]&lt;/SPAN&gt;=$(=vDateSel) &amp;gt; } &lt;SPAN style="font-size: 13.3333330154419px;"&gt;[End Date] &lt;/SPAN&gt;) )&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;(min( {$} TOTAL&lt;/P&gt;&lt;P&gt;([myDate])))),[ID]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My idea is to subtract the minimum of the selected date to the EndDate for each ID. Each ID has its own EndDate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have already the following similar expression and it is working fine:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;=sum(aggr((&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;max({$} TOTAL&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;([myDate])+1)&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;)&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;- (sum({&amp;lt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;myYear=,myMonth=,myDay=, &lt;/SPAN&gt;[myDate]=$(=vDateSel),[End Date]=$(=vDataSel_max)&amp;gt;}&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;([myDate]))),[ID]))&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;I don't understand why it is working for the second one and it is not working for the first one. There are no errors in the defined variables, I am using all of them in other objects. &lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Thanks in advance, &lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Inês&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jun 2015 10:29:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function-problem/m-p/859515#M655056</guid>
      <dc:creator>inescastelhano</dc:creator>
      <dc:date>2015-06-19T10:29:16Z</dc:date>
    </item>
  </channel>
</rss>

