<?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: How to: Sum a value per max day in a given month in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/How-to-Sum-a-value-per-max-day-in-a-given-month/m-p/2072552#M87975</link>
    <description>&lt;P&gt;Try this.&lt;/P&gt;
&lt;P&gt;Sum({$&amp;lt;COMPANYDAY = {'=$(=Max({&amp;lt;COMPANY,COMPANYMONTH,COMPANYYEAR&amp;gt;} COMPANYDAY))'}&amp;gt;} CODECOUNT)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 17 May 2023 16:46:10 GMT</pubDate>
    <dc:creator>Chanty4u</dc:creator>
    <dc:date>2023-05-17T16:46:10Z</dc:date>
    <item>
      <title>How to: Sum a value per max day in a given month</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-Sum-a-value-per-max-day-in-a-given-month/m-p/2072468#M87963</link>
      <description>&lt;P&gt;I feel like this should be an easy solve, but Im having difficulty.&lt;/P&gt;
&lt;P&gt;I have colums such as:&lt;/P&gt;
&lt;P&gt;COMPANY,COMPANYDAY,COMPANYMONTH,COMPANYYEAR,CODECOUNT&lt;/P&gt;
&lt;P&gt;CompanyA, 1/1/2023, Jan, 2023, 1&lt;/P&gt;
&lt;P&gt;CompanyA, 1/15/2023, Jan, 2023, 3&lt;/P&gt;
&lt;P&gt;CompanyA, 1/15/2023, Jan, 2023, 5&lt;/P&gt;
&lt;P&gt;CompanyA, 2/1/2023, Feb, 2023, 2&lt;/P&gt;
&lt;P&gt;CompanyA, 2/28/2023, Feb, 2023, 3&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have data that looks like the above for two years worth.&amp;nbsp; I want to take the maximum date per company, per year and month, and sum the values.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the example above for January 2023 Company A, the sum Im looking for is 8.&amp;nbsp; We find the max date in the record set for Company A, within January of 2023 and that max date is 1/15.&amp;nbsp; We sum the values 3 and 5.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Again, for CompanyA, the sum Im looking for is 3.&amp;nbsp; We found the maximum date for the data given, in this case it is the actual last day of the month 2/28, sum the values which is only 3.&lt;/P&gt;
&lt;P&gt;How do I approach this?&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 14:12:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-Sum-a-value-per-max-day-in-a-given-month/m-p/2072468#M87963</guid>
      <dc:creator>AnalyticsDev</dc:creator>
      <dc:date>2023-05-17T14:12:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to: Sum a value per max day in a given month</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-Sum-a-value-per-max-day-in-a-given-month/m-p/2072552#M87975</link>
      <description>&lt;P&gt;Try this.&lt;/P&gt;
&lt;P&gt;Sum({$&amp;lt;COMPANYDAY = {'=$(=Max({&amp;lt;COMPANY,COMPANYMONTH,COMPANYYEAR&amp;gt;} COMPANYDAY))'}&amp;gt;} CODECOUNT)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 16:46:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-Sum-a-value-per-max-day-in-a-given-month/m-p/2072552#M87975</guid>
      <dc:creator>Chanty4u</dc:creator>
      <dc:date>2023-05-17T16:46:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to: Sum a value per max day in a given month</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-Sum-a-value-per-max-day-in-a-given-month/m-p/2072639#M87983</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/153869"&gt;@AnalyticsDev&lt;/a&gt;&amp;nbsp; Add dimensions&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;COMPANY,COMPANYDAY and below expression&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;=if( COMPANYDAY= aggr(nodistinct FirstSortedValue(distinct COMPANYDAY,-COMPANYDAY),COMPANY,COMPANYMONTH,COMPANYYEAR), sum(CODECOUNT),0)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Uncheck "Include zero values" option&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 22:22:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-Sum-a-value-per-max-day-in-a-given-month/m-p/2072639#M87983</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2023-05-17T22:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to: Sum a value per max day in a given month</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-Sum-a-value-per-max-day-in-a-given-month/m-p/2072737#M87988</link>
      <description>&lt;P&gt;Hi, you could flag the max records within the script.&lt;/P&gt;
&lt;P&gt;Data:&lt;BR /&gt;LOAD * Inline[&lt;BR /&gt;COMPANY,COMPANYDAY,COMPANYMONTH,COMPANYYEAR,CODECOUNT&lt;BR /&gt;CompanyA, 1/1/2023, Jan, 2023, 1&lt;BR /&gt;CompanyA, 1/15/2023, Jan, 2023, 3&lt;BR /&gt;CompanyA, 1/15/2023, Jan, 2023, 5&lt;BR /&gt;CompanyA, 2/1/2023, Feb, 2023, 2&lt;BR /&gt;CompanyA, 2/28/2023, Feb, 2023, 3&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;Left Join(Data)&lt;BR /&gt;LOAD COMPANY,&lt;BR /&gt;Date(Max(COMPANYDAY)) as COMPANYDAY,&lt;BR /&gt;'1' as MaxFlag&lt;/P&gt;
&lt;P&gt;Resident Data&lt;BR /&gt;Group By COMPANY, COMPANYMONTH;&lt;/P&gt;
&lt;P&gt;And then use this as the expression.&lt;/P&gt;
&lt;P&gt;Sum({&amp;lt;MaxFlag={1}&amp;gt;}CODECOUNT)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BrunPierre_1-1684391528914.png" style="width: 553px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/107467i05326382FCE28612/image-dimensions/553x47?v=v2" width="553" height="47" role="button" title="BrunPierre_1-1684391528914.png" alt="BrunPierre_1-1684391528914.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 06:36:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-Sum-a-value-per-max-day-in-a-given-month/m-p/2072737#M87988</guid>
      <dc:creator>BrunPierre</dc:creator>
      <dc:date>2023-05-18T06:36:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to: Sum a value per max day in a given month</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-Sum-a-value-per-max-day-in-a-given-month/m-p/2075123#M88193</link>
      <description>&lt;P&gt;My data model might be a bit weird because of previous requirements... Considering that this is pulling from an excel sheet that I'll need to open each month to add in new data, I made a flag field in the excel to simplify and move on.&amp;nbsp; &amp;nbsp; This is solved (for now).&amp;nbsp; Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 13:34:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-Sum-a-value-per-max-day-in-a-given-month/m-p/2075123#M88193</guid>
      <dc:creator>AnalyticsDev</dc:creator>
      <dc:date>2023-05-24T13:34:03Z</dc:date>
    </item>
  </channel>
</rss>

