<?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 Need Sum of values for most recent date by dimension in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Need-Sum-of-values-for-most-recent-date-by-dimension/m-p/2007132#M83340</link>
    <description>&lt;P&gt;I did find two similar posts, but they didn't address this exact question.&lt;/P&gt;
&lt;P&gt;This seemed pretty simple at first, to just get the sum for the max date, but the problem is I need the sum for the max date for each value of the dimension. So while 11/23/22 is the max date, I will not have values for the other countries.&lt;/P&gt;
&lt;P&gt;I thought something like this might work, but I think I am missing something obvious.&lt;/P&gt;
&lt;P&gt;=Sum(Aggr(If(Date = Max(TOTAL &amp;lt;Country&amp;gt; Date), Sales),Date, Country))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="datagrrl_1-1669044873890.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/94202i9D687DACB8D0DCE7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="datagrrl_1-1669044873890.png" alt="datagrrl_1-1669044873890.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Expected Results&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="datagrrl_0-1669044818658.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/94201i10DC5150D5AB9BB9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="datagrrl_0-1669044818658.png" alt="datagrrl_0-1669044818658.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;TIA, Sample App Attached&lt;/P&gt;</description>
    <pubDate>Mon, 21 Nov 2022 15:44:29 GMT</pubDate>
    <dc:creator>datagrrl</dc:creator>
    <dc:date>2022-11-21T15:44:29Z</dc:date>
    <item>
      <title>Need Sum of values for most recent date by dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Need-Sum-of-values-for-most-recent-date-by-dimension/m-p/2007132#M83340</link>
      <description>&lt;P&gt;I did find two similar posts, but they didn't address this exact question.&lt;/P&gt;
&lt;P&gt;This seemed pretty simple at first, to just get the sum for the max date, but the problem is I need the sum for the max date for each value of the dimension. So while 11/23/22 is the max date, I will not have values for the other countries.&lt;/P&gt;
&lt;P&gt;I thought something like this might work, but I think I am missing something obvious.&lt;/P&gt;
&lt;P&gt;=Sum(Aggr(If(Date = Max(TOTAL &amp;lt;Country&amp;gt; Date), Sales),Date, Country))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="datagrrl_1-1669044873890.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/94202i9D687DACB8D0DCE7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="datagrrl_1-1669044873890.png" alt="datagrrl_1-1669044873890.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Expected Results&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="datagrrl_0-1669044818658.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/94201i10DC5150D5AB9BB9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="datagrrl_0-1669044818658.png" alt="datagrrl_0-1669044818658.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;TIA, Sample App Attached&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2022 15:44:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Need-Sum-of-values-for-most-recent-date-by-dimension/m-p/2007132#M83340</guid>
      <dc:creator>datagrrl</dc:creator>
      <dc:date>2022-11-21T15:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: Need Sum of values for most recent date by dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Need-Sum-of-values-for-most-recent-date-by-dimension/m-p/2007208#M83345</link>
      <description>&lt;P&gt;try this:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;test:&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;LOAD&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Country,&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;"Date",&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Sales&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;FROM [lib://Test1121/TestTable.xlsx]&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;(ooxml, embedded labels, table is Data);&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;left join (test)&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Load&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Country,&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;max("Date") as max_date&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;resident test group by Country;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;use below expression in frontend expression:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Sum({&amp;lt;date={"$(=max_Date)"}&amp;gt;}sales)&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Regards,&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Aditya&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2022 17:44:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Need-Sum-of-values-for-most-recent-date-by-dimension/m-p/2007208#M83345</guid>
      <dc:creator>Aditya_Chitale</dc:creator>
      <dc:date>2022-11-21T17:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: Need Sum of values for most recent date by dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Need-Sum-of-values-for-most-recent-date-by-dimension/m-p/2007228#M83348</link>
      <description>&lt;P&gt;I ended up getting what I expected for a single country with this&lt;/P&gt;
&lt;P&gt;SUM({&amp;lt;Country={'Mexico'},Date={"$(=Max({&amp;lt;Country={'Mexico'}&amp;gt;}Date))"}&amp;gt;}Sales)&lt;/P&gt;
&lt;P&gt;Since I need a KPI for a specific dimension value, this worked for me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2022 18:44:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Need-Sum-of-values-for-most-recent-date-by-dimension/m-p/2007228#M83348</guid>
      <dc:creator>datagrrl</dc:creator>
      <dc:date>2022-11-21T18:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: Need Sum of values for most recent date by dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Need-Sum-of-values-for-most-recent-date-by-dimension/m-p/2007464#M83361</link>
      <description>&lt;P&gt;would rather avoid row level expression search entirely&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;left join (test)&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Load&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Country,&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;,max("Date") as &lt;STRONG&gt;Date&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;,1 as flag_maxDate&lt;/STRONG&gt;&lt;BR /&gt;&lt;EM&gt;resident test group by Country;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;use below expression in frontend expression:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Sum({&amp;lt;&lt;SPAN&gt;flag_maxDate&lt;/SPAN&gt;={1}&amp;gt;}sales)&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2022 09:24:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Need-Sum-of-values-for-most-recent-date-by-dimension/m-p/2007464#M83361</guid>
      <dc:creator>vinieme12</dc:creator>
      <dc:date>2022-11-22T09:24:56Z</dc:date>
    </item>
  </channel>
</rss>

