<?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: Date of aggr formula in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Date-of-aggr-formula/m-p/1247362#M626112</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just a note:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think that&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FirstSortedValue(Distinct Date,&lt;/P&gt;&lt;P style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000;"&gt;-Aggr(Sum(If([Issue Date]&amp;lt;=Date,[Billed amount]))-Sum(If([Payment Date]&amp;lt;=Date,[Paid amount])),Date))&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12px; font-family: arial, helvetica, sans-serif; color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-size: 10pt; font-family: arial, helvetica, sans-serif; font-weight: inherit;"&gt;guarantees that the &lt;SPAN style="text-decoration: underline;"&gt;&lt;EM&gt;max&lt;/EM&gt;&lt;/SPAN&gt; date for the max balance is returned, it returns just any one date with the same sort weight, which one might be depending e.g. on the load order field Date.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;If you want to make your expression more robust, follow e.g. Manish's last suggested solution (though I think the small value proportional to Date should be added, not subtracted, but could be wrong).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Nov 2016 21:54:15 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2016-11-29T21:54:15Z</dc:date>
    <item>
      <title>Date of aggr formula</title>
      <link>https://community.qlik.com/t5/QlikView/Date-of-aggr-formula/m-p/1247357#M626102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fellows,&lt;/P&gt;&lt;P&gt;I have a formula to return maximum value exposed in a customer:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_1480447120535232" jivemacro_uid="_1480447120535232" modifiedtitle="true"&gt;
&lt;P&gt;Max(Aggr(Sum(If([Issue Date]&amp;lt;=Date,[Billed amount]))-Sum(If([Payment Date]&amp;lt;=Date,[Paid amount])),Date))&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;This sum all billed amount before a date and subtract all paid amount before the same date.&lt;/P&gt;&lt;P&gt;Aggr gives me an statement with balance (&lt;SPAN style="font-size: 13.3333px;"&gt;Billed amount - Paid amount)&lt;/SPAN&gt; day after day (Date).&lt;/P&gt;&lt;P&gt;Columns are: Date, Billed amount, Paid amount, &lt;SPAN style="font-size: 13.3333px;"&gt;Balance&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/145171_Capture.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;First objective was to get highest balance value. That is done.&lt;/P&gt;&lt;P&gt;Secondary is to get last Date when highest balance occurs (I am considering the possibility of having same balance for more than one row).&lt;/P&gt;&lt;P&gt;How to get this 'last Date'? I already tried Firstsortedvalue but not luck.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Nov 2016 19:29:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-of-aggr-formula/m-p/1247357#M626102</guid>
      <dc:creator>h_demarco</dc:creator>
      <dc:date>2016-11-29T19:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: Date of aggr formula</title>
      <link>https://community.qlik.com/t5/QlikView/Date-of-aggr-formula/m-p/1247358#M626104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FirstSortedValue(Date,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;-Aggr(Sum(If([Issue Date]&amp;lt;=Date,[Billed amount]))-Sum(If([Payment Date]&amp;lt;=Date,[Paid amount])),Date))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;Or &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;FirstSortedValue(Distinct Date,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;-Aggr(Sum(If([Issue Date]&amp;lt;=Date,[Billed amount]))-Sum(If([Payment Date]&amp;lt;=Date,[Paid amount])),Date))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Nov 2016 19:30:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-of-aggr-formula/m-p/1247358#M626104</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2016-11-29T19:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: Date of aggr formula</title>
      <link>https://community.qlik.com/t5/QlikView/Date-of-aggr-formula/m-p/1247359#M626106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would you be able to share your application or a sample with expected output?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Nov 2016 19:30:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-of-aggr-formula/m-p/1247359#M626106</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-11-29T19:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: Date of aggr formula</title>
      <link>https://community.qlik.com/t5/QlikView/Date-of-aggr-formula/m-p/1247360#M626108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FirstSortedValue(Distinct Date,&lt;/P&gt;&lt;P style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000;"&gt;-Aggr(Sum(If([Issue Date]&amp;lt;=Date,[Billed amount]))-Sum(If([Payment Date]&amp;lt;=Date,[Paid amount]))-Date/1E6,Date))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Nov 2016 19:34:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-of-aggr-formula/m-p/1247360#M626108</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2016-11-29T19:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: Date of aggr formula</title>
      <link>https://community.qlik.com/t5/QlikView/Date-of-aggr-formula/m-p/1247361#M626110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Second option worked.&lt;/P&gt;&lt;P&gt;Thanks for your fast reply.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Nov 2016 21:07:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-of-aggr-formula/m-p/1247361#M626110</guid>
      <dc:creator>h_demarco</dc:creator>
      <dc:date>2016-11-29T21:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: Date of aggr formula</title>
      <link>https://community.qlik.com/t5/QlikView/Date-of-aggr-formula/m-p/1247362#M626112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just a note:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think that&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FirstSortedValue(Distinct Date,&lt;/P&gt;&lt;P style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000;"&gt;-Aggr(Sum(If([Issue Date]&amp;lt;=Date,[Billed amount]))-Sum(If([Payment Date]&amp;lt;=Date,[Paid amount])),Date))&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12px; font-family: arial, helvetica, sans-serif; color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-size: 10pt; font-family: arial, helvetica, sans-serif; font-weight: inherit;"&gt;guarantees that the &lt;SPAN style="text-decoration: underline;"&gt;&lt;EM&gt;max&lt;/EM&gt;&lt;/SPAN&gt; date for the max balance is returned, it returns just any one date with the same sort weight, which one might be depending e.g. on the load order field Date.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;If you want to make your expression more robust, follow e.g. Manish's last suggested solution (though I think the small value proportional to Date should be added, not subtracted, but could be wrong).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Nov 2016 21:54:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-of-aggr-formula/m-p/1247362#M626112</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-11-29T21:54:15Z</dc:date>
    </item>
  </channel>
</rss>

