<?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 Gets only the values of max date transaction in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Gets-only-the-values-of-max-date-transaction/m-p/955369#M328378</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to realize a straight table to show the sum by customer of the last transaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With the example below, I need to show:&lt;/P&gt;&lt;P&gt;for the Customer01 and TypeA the value 15&lt;/P&gt;&lt;P&gt;for the Customer20 and TypeA the value 3&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;for the Customer01 and TypeB the value 5&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;for the Customer20 and TypeB the value 9&lt;/P&gt;&lt;P&gt;and so on...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can find the MaxDate for any Customer/Type, but when I try to use this function to select only my records with set analysis, it doesn't work fine.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Qlik.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/106291_Qlik.png" style="height: 298px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;maxDate for type:&lt;/P&gt;&lt;P&gt;Max({$&amp;lt;SalesType = {'TypeA'}&amp;gt;}&amp;nbsp; Aggr(Max(DateId), Customer, SalesType))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The relative Qty: &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Sum({$&amp;lt;SalesType = {"TypeA"}, DateId = {"$(=Max({$&amp;lt;SalesType = {'TypeA'}&amp;gt;}&amp;nbsp; Aggr(Max(DateId), Customer, SalesType)))"} &amp;gt;} Qty)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it works only for the max value in absolute and not for the max value for Customer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can find teh Qvw in attach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks everyone for the support &lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;&lt;P&gt;Andrea&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 21 Nov 2015 10:37:32 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-11-21T10:37:32Z</dc:date>
    <item>
      <title>Gets only the values of max date transaction</title>
      <link>https://community.qlik.com/t5/QlikView/Gets-only-the-values-of-max-date-transaction/m-p/955369#M328378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to realize a straight table to show the sum by customer of the last transaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With the example below, I need to show:&lt;/P&gt;&lt;P&gt;for the Customer01 and TypeA the value 15&lt;/P&gt;&lt;P&gt;for the Customer20 and TypeA the value 3&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;for the Customer01 and TypeB the value 5&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;for the Customer20 and TypeB the value 9&lt;/P&gt;&lt;P&gt;and so on...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can find the MaxDate for any Customer/Type, but when I try to use this function to select only my records with set analysis, it doesn't work fine.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Qlik.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/106291_Qlik.png" style="height: 298px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;maxDate for type:&lt;/P&gt;&lt;P&gt;Max({$&amp;lt;SalesType = {'TypeA'}&amp;gt;}&amp;nbsp; Aggr(Max(DateId), Customer, SalesType))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The relative Qty: &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Sum({$&amp;lt;SalesType = {"TypeA"}, DateId = {"$(=Max({$&amp;lt;SalesType = {'TypeA'}&amp;gt;}&amp;nbsp; Aggr(Max(DateId), Customer, SalesType)))"} &amp;gt;} Qty)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it works only for the max value in absolute and not for the max value for Customer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can find teh Qvw in attach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks everyone for the support &lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;&lt;P&gt;Andrea&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Nov 2015 10:37:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Gets-only-the-values-of-max-date-transaction/m-p/955369#M328378</guid>
      <dc:creator />
      <dc:date>2015-11-21T10:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: Gets only the values of max date transaction</title>
      <link>https://community.qlik.com/t5/QlikView/Gets-only-the-values-of-max-date-transaction/m-p/955370#M328379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Set analysis will be evaluated once per chart, not per dimension line, so the max date won't be calculated per customer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe like this&lt;/P&gt;&lt;P&gt;=FirstSortedValue( {$&amp;lt;SalesType = {"TypeA"} &amp;gt;} Aggr( Sum({$&amp;lt;SalesType = {"TypeA"} &amp;gt;} Qty), Customer, DateId), Aggr( -Only({$&amp;lt;SalesType = {"TypeA"} &amp;gt;} DateId) , Customer, DateId))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Nov 2015 11:47:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Gets-only-the-values-of-max-date-transaction/m-p/955370#M328379</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-11-21T11:47:43Z</dc:date>
    </item>
    <item>
      <title>Re: Gets only the values of max date transaction</title>
      <link>https://community.qlik.com/t5/QlikView/Gets-only-the-values-of-max-date-transaction/m-p/955371#M328380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="106295" alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/106295_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FirstSortedValue({$&amp;lt;SalesType = {"TypeA"}&amp;gt;} Aggr(Sum({$&amp;lt;SalesType = {"TypeA"}&amp;gt;} Qty), Customer, DateId), -Aggr(Only({$&amp;lt;SalesType = {"TypeA"}&amp;gt;} DateId), Customer, DateId))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Nov 2015 11:53:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Gets-only-the-values-of-max-date-transaction/m-p/955371#M328380</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-11-21T11:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: Gets only the values of max date transaction</title>
      <link>https://community.qlik.com/t5/QlikView/Gets-only-the-values-of-max-date-transaction/m-p/955372#M328381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG alt="1.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/106298_1.png" style="height: auto; width: auto;" /&gt;&lt;/P&gt;&lt;P&gt;sum(aggr(if(max(TOTAL &amp;lt;Customer,SalesType&amp;gt; DateId)=max(DateId), sum(Qty)), Customer, SalesType, DateId))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Nov 2015 12:02:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Gets-only-the-values-of-max-date-transaction/m-p/955372#M328381</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-11-21T12:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: Gets only the values of max date transaction</title>
      <link>https://community.qlik.com/t5/QlikView/Gets-only-the-values-of-max-date-transaction/m-p/955373#M328382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thans to all for your suggestions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that the maxgro's solution:&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;sum(aggr(if(max(TOTAL &amp;lt;Customer,SalesType&amp;gt; DateId)=max(DateId), sum(Qty)), Customer, SalesType, DateId))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is better for me because it returns the correct result for all the levels, general total included.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bye&lt;/P&gt;&lt;P&gt;Andrea&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Nov 2015 10:21:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Gets-only-the-values-of-max-date-transaction/m-p/955373#M328382</guid>
      <dc:creator />
      <dc:date>2015-11-23T10:21:15Z</dc:date>
    </item>
  </channel>
</rss>

