<?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 Sum value for max date in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Sum-value-for-max-date/m-p/1519810#M37149</link>
    <description>&lt;P&gt;I need the total&amp;nbsp; value for each company for the maximum month (and also for maximum month -1).&amp;nbsp; My calculation is working as long there is data for all months but once there is a month missing (in the example november is missing for company A)&amp;nbsp; the calculation of that value is wrong.&amp;nbsp; This is the calculation I used for Sum Cur Month: sum({&amp;lt;YearMonth={"$(=Date(max(Date#(YearMonth, 'MMM-YYYY')),'MMM-YYYY'))"}&amp;gt;}&lt;BR /&gt;Counter).&amp;nbsp;&lt;/P&gt;&lt;P&gt;The calculation that I used for column current month is working like expected: Date(max(Date#(YearMonth, 'MMM-YYYY')),'MMM-YYYY')&lt;/P&gt;&lt;P&gt;Why is that sum function not using the maximum month value for that company as filter, it seems like it is using november 2018 for all companies&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="sum example.jpg" style="width: 960px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/2047i8F836602DA9C63BA/image-size/large?v=v2&amp;amp;px=999" role="button" title="sum example.jpg" alt="sum example.jpg" /&gt;&lt;/span&gt;(Photo shows a simplified version of the data, it is also possible to filter on company, period and a couple of other dimensions.&amp;nbsp; Data should be updated with the selected filters)&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 07:03:58 GMT</pubDate>
    <dc:creator>geertdeman</dc:creator>
    <dc:date>2024-11-16T07:03:58Z</dc:date>
    <item>
      <title>Sum value for max date</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-value-for-max-date/m-p/1519810#M37149</link>
      <description>&lt;P&gt;I need the total&amp;nbsp; value for each company for the maximum month (and also for maximum month -1).&amp;nbsp; My calculation is working as long there is data for all months but once there is a month missing (in the example november is missing for company A)&amp;nbsp; the calculation of that value is wrong.&amp;nbsp; This is the calculation I used for Sum Cur Month: sum({&amp;lt;YearMonth={"$(=Date(max(Date#(YearMonth, 'MMM-YYYY')),'MMM-YYYY'))"}&amp;gt;}&lt;BR /&gt;Counter).&amp;nbsp;&lt;/P&gt;&lt;P&gt;The calculation that I used for column current month is working like expected: Date(max(Date#(YearMonth, 'MMM-YYYY')),'MMM-YYYY')&lt;/P&gt;&lt;P&gt;Why is that sum function not using the maximum month value for that company as filter, it seems like it is using november 2018 for all companies&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="sum example.jpg" style="width: 960px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/2047i8F836602DA9C63BA/image-size/large?v=v2&amp;amp;px=999" role="button" title="sum example.jpg" alt="sum example.jpg" /&gt;&lt;/span&gt;(Photo shows a simplified version of the data, it is also possible to filter on company, period and a couple of other dimensions.&amp;nbsp; Data should be updated with the selected filters)&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 07:03:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-value-for-max-date/m-p/1519810#M37149</guid>
      <dc:creator>geertdeman</dc:creator>
      <dc:date>2024-11-16T07:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: Sum value for max date</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-value-for-max-date/m-p/1519846#M37155</link>
      <description>&lt;P&gt;Set analysis is evaluated once per chart and not once per dimension... in your case, set analysis is evaluated to be Nov-2018 for the whole chart... so unfortunately, you cannot use set analysis in this case, unless you create a max month flag in the script and use that in your set analysis where for company A, Oct is flagged as 1 and for Company B and C, Nov is flagged as 1.&lt;/P&gt;&lt;P&gt;Alternative to this would be to use something like this&lt;/P&gt;&lt;PRE&gt;FirstSortedValue(Aggr(Sum(Counter), YearMonth, Company), -Aggr(Date#(YearMonth, 'MMM-YYYY'), YearMonth, Company))&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Dec 2018 13:15:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-value-for-max-date/m-p/1519846#M37155</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-12-12T13:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: Sum value for max date</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-value-for-max-date/m-p/1520299#M37224</link>
      <description>Thanks!!! it is working</description>
      <pubDate>Thu, 13 Dec 2018 10:24:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-value-for-max-date/m-p/1520299#M37224</guid>
      <dc:creator>geertdeman</dc:creator>
      <dc:date>2018-12-13T10:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: Sum value for max date</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-value-for-max-date/m-p/1520311#M37226</link>
      <description>&lt;P&gt;that is working for the current month, but can I use that also for the previous month?&amp;nbsp; In the output I show the value for the current month and in another column the value of the previous month&lt;/P&gt;</description>
      <pubDate>Thu, 13 Dec 2018 10:40:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-value-for-max-date/m-p/1520311#M37226</guid>
      <dc:creator>geertdeman</dc:creator>
      <dc:date>2018-12-13T10:40:20Z</dc:date>
    </item>
    <item>
      <title>Re: Sum value for max date</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-value-for-max-date/m-p/1520373#M37231</link>
      <description>Would you be able to elaborate on what you would want to see as the output based on your sample data?</description>
      <pubDate>Thu, 13 Dec 2018 11:55:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-value-for-max-date/m-p/1520373#M37231</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-12-13T11:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: Sum value for max date</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-value-for-max-date/m-p/1520427#M37239</link>
      <description>&lt;P&gt;It is the data for the previous month, it is visible in the example, the column Sum prev.&amp;nbsp; For company B and C it is the value for October, for A it is the data for September.&amp;nbsp; Additional question, what if there are some default filters that needs be applied on other fields, not visible in the app.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Dec 2018 13:07:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-value-for-max-date/m-p/1520427#M37239</guid>
      <dc:creator>geertdeman</dc:creator>
      <dc:date>2018-12-13T13:07:16Z</dc:date>
    </item>
    <item>
      <title>Re: Sum value for max date</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-value-for-max-date/m-p/1520432#M37241</link>
      <description>&lt;P&gt;You only have Company as the dimension of your chart? If that is correct, try this&lt;/P&gt;&lt;PRE&gt;FirstSortedValue(&lt;BR /&gt;  Aggr(&lt;BR /&gt;    Sum(Counter)&lt;BR /&gt;  , YearMonth, Company),&lt;BR /&gt;  -Aggr(&lt;BR /&gt;    Date#(YearMonth, 'MMM-YYYY')&lt;BR /&gt;  , YearMonth, Company)&lt;FONT color="#FF0000"&gt;,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;2&lt;/FONT&gt;)&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Dec 2018 13:11:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-value-for-max-date/m-p/1520432#M37241</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-12-13T13:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: Sum value for max date</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-value-for-max-date/m-p/1520472#M37247</link>
      <description>&lt;P&gt;also that is working!&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Dec 2018 13:56:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-value-for-max-date/m-p/1520472#M37247</guid>
      <dc:creator>geertdeman</dc:creator>
      <dc:date>2018-12-13T13:56:12Z</dc:date>
    </item>
    <item>
      <title>Re: Sum value for max date</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-value-for-max-date/m-p/1520478#M37248</link>
      <description>Awesome &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Thu, 13 Dec 2018 13:59:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-value-for-max-date/m-p/1520478#M37248</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-12-13T13:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: Sum value for max date</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-value-for-max-date/m-p/1520894#M37295</link>
      <description>&lt;P&gt;Another issue that I have, that first column company&amp;nbsp;is a calculation:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pick($(vAux.Compliance.QPPVFlagValue),&lt;BR /&gt;[REC_COMP_CATEGORY_CHANGED],&lt;BR /&gt;[REC_COMP_REGION_GROUPING],&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;But that doesn't seems to work as field value in the firstsortedvalue function&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Dec 2018 09:22:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-value-for-max-date/m-p/1520894#M37295</guid>
      <dc:creator>geertdeman</dc:creator>
      <dc:date>2018-12-14T09:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: Sum value for max date</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-value-for-max-date/m-p/1521014#M37305</link>
      <description>Are you picking one of the two dimensions based on this variable value? $(vAux.Compliance.QPPVFlagValue)</description>
      <pubDate>Fri, 14 Dec 2018 12:01:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-value-for-max-date/m-p/1521014#M37305</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-12-14T12:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: Sum value for max date</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-value-for-max-date/m-p/1521424#M37368</link>
      <description>correct</description>
      <pubDate>Mon, 17 Dec 2018 07:34:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-value-for-max-date/m-p/1521424#M37368</guid>
      <dc:creator>geertdeman</dc:creator>
      <dc:date>2018-12-17T07:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: Sum value for max date</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-value-for-max-date/m-p/1521537#M37375</link>
      <description>&lt;P&gt;Then I believe dollar sign expansion should work&lt;/P&gt;&lt;PRE&gt;$(= '[' &amp;amp; Pick($(vAux.Compliance.QPPVFlagValue),
'REC_COMP_CATEGORY_CHANGED',
'REC_COMP_REGION_GROUPING',
) &amp;amp; ']')&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 Dec 2018 12:10:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-value-for-max-date/m-p/1521537#M37375</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-12-17T12:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: Sum value for max date</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-value-for-max-date/m-p/1522438#M37469</link>
      <description>&lt;P&gt;it didn't work the first time, I tried to modify it and changed it back to your solution and it is working now!&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2018 09:33:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-value-for-max-date/m-p/1522438#M37469</guid>
      <dc:creator>geertdeman</dc:creator>
      <dc:date>2018-12-19T09:33:07Z</dc:date>
    </item>
  </channel>
</rss>

