<?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 Problem with AGGR and MAX Value on a DateRange in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-with-AGGR-and-MAX-Value-on-a-DateRange/m-p/1100177#M895737</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got some problem to solve my expression, i tried a ton of solution but none worked...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have this table : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;idData,codedocData, contributionData, DateData&lt;/P&gt;&lt;P&gt;1,&amp;nbsp; 1, 1,&amp;nbsp; 01/02/2015&lt;/P&gt;&lt;P&gt;2,&amp;nbsp; 1, 11, 01/02/2015&lt;/P&gt;&lt;P&gt;3,&amp;nbsp; 1, 12, 01/03/2015&lt;/P&gt;&lt;P&gt;4,&amp;nbsp; 1, 19, 05/03/2015&lt;/P&gt;&lt;P&gt;5,&amp;nbsp; 1, 15, 15/03/2015&lt;/P&gt;&lt;P&gt;6,&amp;nbsp; 2, 1,&amp;nbsp; 03/03/2015&lt;/P&gt;&lt;P&gt;7,&amp;nbsp; 2, 11, 03/03/2015&lt;/P&gt;&lt;P&gt;8,&amp;nbsp; 2, 12, 03/03/2015&lt;/P&gt;&lt;P&gt;9,&amp;nbsp; 2, 19, 07/03/2015&lt;/P&gt;&lt;P&gt;10, 2, 15, 20/03/2015&lt;/P&gt;&lt;P&gt;11, 1, 59, 21/03/2015&lt;/P&gt;&lt;P&gt;12, 1, 15, 30/03/2015&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to find between a range of date (StartDate, EndDate) the value (contributiondata) of the max idData by codedoc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the attached qvw.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks if someone can help me !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator />
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Problem with AGGR and MAX Value on a DateRange</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-AGGR-and-MAX-Value-on-a-DateRange/m-p/1100177#M895737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got some problem to solve my expression, i tried a ton of solution but none worked...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have this table : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;idData,codedocData, contributionData, DateData&lt;/P&gt;&lt;P&gt;1,&amp;nbsp; 1, 1,&amp;nbsp; 01/02/2015&lt;/P&gt;&lt;P&gt;2,&amp;nbsp; 1, 11, 01/02/2015&lt;/P&gt;&lt;P&gt;3,&amp;nbsp; 1, 12, 01/03/2015&lt;/P&gt;&lt;P&gt;4,&amp;nbsp; 1, 19, 05/03/2015&lt;/P&gt;&lt;P&gt;5,&amp;nbsp; 1, 15, 15/03/2015&lt;/P&gt;&lt;P&gt;6,&amp;nbsp; 2, 1,&amp;nbsp; 03/03/2015&lt;/P&gt;&lt;P&gt;7,&amp;nbsp; 2, 11, 03/03/2015&lt;/P&gt;&lt;P&gt;8,&amp;nbsp; 2, 12, 03/03/2015&lt;/P&gt;&lt;P&gt;9,&amp;nbsp; 2, 19, 07/03/2015&lt;/P&gt;&lt;P&gt;10, 2, 15, 20/03/2015&lt;/P&gt;&lt;P&gt;11, 1, 59, 21/03/2015&lt;/P&gt;&lt;P&gt;12, 1, 15, 30/03/2015&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to find between a range of date (StartDate, EndDate) the value (contributiondata) of the max idData by codedoc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the attached qvw.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks if someone can help me !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-AGGR-and-MAX-Value-on-a-DateRange/m-p/1100177#M895737</guid>
      <dc:creator />
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with AGGR and MAX Value on a DateRange</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-AGGR-and-MAX-Value-on-a-DateRange/m-p/1100178#M895738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this is what you want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just FYI Just put the date as it is in Inputbox, no need to use date function for that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kaushik Solanki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Aug 2016 10:16:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-AGGR-and-MAX-Value-on-a-DateRange/m-p/1100178#M895738</guid>
      <dc:creator>kaushiknsolanki</dc:creator>
      <dc:date>2016-08-01T10:16:48Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with AGGR and MAX Value on a DateRange</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-AGGR-and-MAX-Value-on-a-DateRange/m-p/1100179#M895739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why are you taking this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Date('01/03/2015')&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Aug 2016 10:20:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-AGGR-and-MAX-Value-on-a-DateRange/m-p/1100179#M895739</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2016-08-01T10:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with AGGR and MAX Value on a DateRange</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-AGGR-and-MAX-Value-on-a-DateRange/m-p/1100180#M895740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks man !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please explain this expression : &lt;/P&gt;&lt;P&gt;Sum( {&amp;lt;idData = {$(=Concat(total&amp;lt;codedocData&amp;gt; aggr( MAX({&amp;lt;DateData = {'&amp;gt;=$(vStart)&amp;lt;=$(vFrom)'} &amp;gt;}idData),codedocData),','))}&amp;gt;}contributionData)&lt;/P&gt;&lt;P&gt;for a new Qlik user?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Aug 2016 10:32:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-AGGR-and-MAX-Value-on-a-DateRange/m-p/1100180#M895740</guid>
      <dc:creator />
      <dc:date>2016-08-01T10:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with AGGR and MAX Value on a DateRange</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-AGGR-and-MAX-Value-on-a-DateRange/m-p/1100181#M895741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I took this to test my range date with a begining and a end.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Aug 2016 10:34:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-AGGR-and-MAX-Value-on-a-DateRange/m-p/1100181#M895741</guid>
      <dc:creator />
      <dc:date>2016-08-01T10:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with AGGR and MAX Value on a DateRange</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-AGGR-and-MAX-Value-on-a-DateRange/m-p/1100182#M895742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is this what you want to get?&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/133171_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used this expression:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Max({&amp;lt; DateData = {"$(='&amp;gt;=' &amp;amp; vStart &amp;amp; '&amp;lt;=' &amp;amp; vFrom)"} &amp;gt;} idData)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2 changes I did was to remove Aggr() function and the other one was to change the set analysis around. I removed Aggr(), because I didn't think it was required here. For set analysis, I think the best way is to check what you get when you put it in a text box object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You had this: &lt;STRONG&gt;='&amp;gt;=' &amp;amp; Date($(vStart)) &amp;amp; '&amp;lt;=' &amp;amp; Date($(vFrom))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/133172_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where as I played around with it by first removing the Date() function and then the dollar sign expansion to get this: &lt;STRONG&gt;='&amp;gt;=' &amp;amp; vStart &amp;amp; '&amp;lt;=' &amp;amp; vFrom&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-3" src="https://community.qlik.com/legacyfs/online/133173_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once you got the right date range in the right date field format, all you need is to take the text box expression and put it within the dollar sign expansion:&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;Max({&amp;lt; DateData = {"$(&lt;SPAN style="color: #ff0000;"&gt;='&amp;gt;=' &amp;amp; vStart &amp;amp; '&amp;lt;=' &amp;amp; vFrom&lt;/SPAN&gt;)"} &amp;gt;} idData)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Aug 2016 10:36:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-AGGR-and-MAX-Value-on-a-DateRange/m-p/1100182#M895742</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-08-01T10:36:41Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with AGGR and MAX Value on a DateRange</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-AGGR-and-MAX-Value-on-a-DateRange/m-p/1100183#M895743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you use the Max function in Set analysis, it will give you Max for overall set and not for individual dimension value, so what i did is I took the Max at Individual level and concatenated them, so that I can pass them in set analysis and get the required result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f2f2f2;"&gt;$(=Concat(total&amp;lt;codedocData&amp;gt; aggr( MAX({&amp;lt;DateData = {'&amp;gt;=$(vStart)&amp;lt;=$(vFrom)'} &amp;gt;}idData),codedocData),','))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f2f2f2;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f2f2f2;"&gt;This function will do that.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Aug 2016 11:03:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-AGGR-and-MAX-Value-on-a-DateRange/m-p/1100183#M895743</guid>
      <dc:creator>kaushiknsolanki</dc:creator>
      <dc:date>2016-08-01T11:03:51Z</dc:date>
    </item>
  </channel>
</rss>

