<?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: Sum if date equals max date per dimension in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sum-if-date-equals-max-date-per-dimension/m-p/1294844#M404334</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've added a screenshot for Fin Month 3 (I unfortunately don't have the data in the model required to do Fin Month 4).&amp;nbsp; So in this case the max date (or Max(SK Ldow No) ) is 20161224 for supplier 1 and 20161210 for supplier 2&lt;/P&gt;&lt;P&gt;&lt;IMG alt="FinMonth3.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/162443_FinMonth3.png" style="height: 157px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 May 2017 06:00:26 GMT</pubDate>
    <dc:creator>nsm1234567</dc:creator>
    <dc:date>2017-05-08T06:00:26Z</dc:date>
    <item>
      <title>Sum if date equals max date per dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-if-date-equals-max-date-per-dimension/m-p/1294840#M404330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi There,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm hoping someone can assist with an issue I'm having putting together a fairly complex expression.&amp;nbsp; If you look at the attached .qvw, you'll see I have two suppliers.&amp;nbsp; The max date for MySupplier 1 is 20161008 and the max date for MySupplier 2 is 20161022 (as you can see from the "Max Date Per Supplier" expression).&amp;nbsp; What I want to do is sum the value where the date is equal to the max date for each MySupplier.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you look at the hardcoded date expressions, what I want is a single expression that gives 2145432.66 for MySupplier 1 and 144478.62 for MySupplier 2 (highlighted in image attached).&amp;nbsp; The big complication is the way the underlying data is structured and I'm not able to figure out how to create the expression to accommodate this.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any assistance would be greatly appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 May 2017 14:31:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-if-date-equals-max-date-per-dimension/m-p/1294840#M404330</guid>
      <dc:creator>nsm1234567</dc:creator>
      <dc:date>2017-05-05T14:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: Sum if date equals max date per dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-if-date-equals-max-date-per-dimension/m-p/1294841#M404331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IS this you are expecting?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 May 2017 15:43:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-if-date-equals-max-date-per-dimension/m-p/1294841#M404331</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-05-05T15:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: Sum if date equals max date per dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-if-date-equals-max-date-per-dimension/m-p/1294842#M404332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;Hi Anil,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Thanks for the response.&amp;nbsp; That isn't quite what I'm looking for.&amp;nbsp; Ideally, the final view would look like the screenshot below.&amp;nbsp; The Max Date that should be used is the "Max Date Per Supplier" which could be different for each supplier.&amp;nbsp; The below example has only two dates, but there could be many max dates for different suppliers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Display.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/162439_Display.png" style="height: 168px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 May 2017 05:40:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-if-date-equals-max-date-per-dimension/m-p/1294842#M404332</guid>
      <dc:creator>nsm1234567</dc:creator>
      <dc:date>2017-05-08T05:40:33Z</dc:date>
    </item>
    <item>
      <title>Re: Sum if date equals max date per dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-if-date-equals-max-date-per-dimension/m-p/1294843#M404333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you select 4 and then tell us required result&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/162440_Capture.PNG" style="height: 113px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 May 2017 05:49:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-if-date-equals-max-date-per-dimension/m-p/1294843#M404333</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-05-08T05:49:18Z</dc:date>
    </item>
    <item>
      <title>Re: Sum if date equals max date per dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-if-date-equals-max-date-per-dimension/m-p/1294844#M404334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've added a screenshot for Fin Month 3 (I unfortunately don't have the data in the model required to do Fin Month 4).&amp;nbsp; So in this case the max date (or Max(SK Ldow No) ) is 20161224 for supplier 1 and 20161210 for supplier 2&lt;/P&gt;&lt;P&gt;&lt;IMG alt="FinMonth3.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/162443_FinMonth3.png" style="height: 157px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 May 2017 06:00:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-if-date-equals-max-date-per-dimension/m-p/1294844#M404334</guid>
      <dc:creator>nsm1234567</dc:creator>
      <dc:date>2017-05-08T06:00:26Z</dc:date>
    </item>
    <item>
      <title>Re: Sum if date equals max date per dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-if-date-equals-max-date-per-dimension/m-p/1294845#M404335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be a slight change in the data model where you add this to your script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Left Join (TEST)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD Distinct [SK Style No],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; MySupplier as MySupplierNew&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resident TEST&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Where Len(Trim(MySupplier)) &amp;gt; 0;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then this as your expression&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=FirstSortedValue(Aggr(If(Len(Trim(MySupplier)) &amp;gt; 0, Sum(Value)), MySupplierNew, [SK Ldow No]), -Aggr(If(Len(Trim(MySupplier)) &amp;gt; 0, [SK Ldow No]), MySupplierNew, [SK Ldow No]))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/162487_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 May 2017 13:42:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-if-date-equals-max-date-per-dimension/m-p/1294845#M404335</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-05-08T13:42:17Z</dc:date>
    </item>
    <item>
      <title>Re: Sum if date equals max date per dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-if-date-equals-max-date-per-dimension/m-p/1294846#M404336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, There.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a similar question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to create a stock control, and I need to se the stock value per max date dimension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I can't create an expression that show the Stock Value at the Max Date per Month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I Tried this follow expression&lt;/P&gt;&lt;P&gt;=sum(if('DATE'=max(total('DATE')), Value))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But wasn't work.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capturar.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/213878_Capturar.PNG" style="height: 137px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2018 19:28:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-if-date-equals-max-date-per-dimension/m-p/1294846#M404336</guid>
      <dc:creator>guilhermeluvizo</dc:creator>
      <dc:date>2018-09-18T19:28:32Z</dc:date>
    </item>
  </channel>
</rss>

