<?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: Max date value in scripting in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Max-date-value-in-scripting/m-p/1667813#M728473</link>
    <description>&lt;P&gt;from what I get that you're taking the Max date as a reference, I'll propose this:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Data:

LOAD RowNo() as IDl,* INLINE [

    ContactID, SeqNumber, Date, Sales
    100123, 1000, 4/7/2019, 5000
    100123, 1000, 15/08/2019, 5000
    100123, 1000, 25/09/2019, 2000
    100123, 1001, 25/09/2019, 2500
];

inner join

load 
FirstSortedValue(IDl, -Date) as IDl

resident Data
group by ContactID,SeqNumber;&lt;/LI-CODE&gt;&lt;P&gt;output:&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-inline" image-alt="Capture.JPG" style="width: 382px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/27233i3D856C0252445918/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Jan 2020 15:23:33 GMT</pubDate>
    <dc:creator>Taoufiq_Zarra</dc:creator>
    <dc:date>2020-01-21T15:23:33Z</dc:date>
    <item>
      <title>Max date value in scripting</title>
      <link>https://community.qlik.com/t5/QlikView/Max-date-value-in-scripting/m-p/1667588#M728472</link>
      <description>&lt;P&gt;Hi Community,&lt;/P&gt;&lt;P&gt;I Have to show Max Value records ..&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Table:&lt;/STRONG&gt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;TD&gt;1001&lt;/TD&gt;&lt;TD&gt;25/09/2019&lt;/TD&gt;&lt;TD&gt;2500&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MaxValue:&lt;BR /&gt;Load * inline [&lt;BR /&gt;ContactID, SeqNumber, Date, Sales&lt;BR /&gt;100123, 1000, 4/7/2019, 5000&lt;BR /&gt;100123, 1000, 15/08/2019 ,5000&lt;BR /&gt;100123, 1000, 25/09/2019, 2000&lt;BR /&gt;100123, 1001, 25/09/2019, 2500&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;JOIN&lt;BR /&gt;Load&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ContactID,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SeqNumber,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Date(Max(Date)) as Date,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FirstSortedValue(Sales, -Date) as MaxValue&lt;BR /&gt;Resident MaxValue&lt;BR /&gt;Group By ContactID,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SeqNumber;&lt;/P&gt;&lt;P&gt;I have written firstsortedvalue, but value not coming proper..&lt;/P&gt;&lt;P&gt;What did i wrong here, can you please help me!&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks In Advance!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 01:28:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-date-value-in-scripting/m-p/1667588#M728472</guid>
      <dc:creator>paulwalker</dc:creator>
      <dc:date>2024-11-16T01:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: Max date value in scripting</title>
      <link>https://community.qlik.com/t5/QlikView/Max-date-value-in-scripting/m-p/1667813#M728473</link>
      <description>&lt;P&gt;from what I get that you're taking the Max date as a reference, I'll propose this:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Data:

LOAD RowNo() as IDl,* INLINE [

    ContactID, SeqNumber, Date, Sales
    100123, 1000, 4/7/2019, 5000
    100123, 1000, 15/08/2019, 5000
    100123, 1000, 25/09/2019, 2000
    100123, 1001, 25/09/2019, 2500
];

inner join

load 
FirstSortedValue(IDl, -Date) as IDl

resident Data
group by ContactID,SeqNumber;&lt;/LI-CODE&gt;&lt;P&gt;output:&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-inline" image-alt="Capture.JPG" style="width: 382px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/27233i3D856C0252445918/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2020 15:23:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-date-value-in-scripting/m-p/1667813#M728473</guid>
      <dc:creator>Taoufiq_Zarra</dc:creator>
      <dc:date>2020-01-21T15:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: Max date value in scripting</title>
      <link>https://community.qlik.com/t5/QlikView/Max-date-value-in-scripting/m-p/1676766#M728474</link>
      <description>&lt;P&gt;Did Taoufiq's response help you get things working?&amp;nbsp; If so, do not forget to return to your thread and use the Accept as Solution button to give him credit for the assistance and let other Members know it did work.&amp;nbsp; We really appreciate it when folks close out their threads, so if you did something different, please consider posting that and then you can use the button to mark that post as the solution too.&amp;nbsp; If you are still trying to sort things out, please leave an update with what you still need.&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Brett&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2020 16:44:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-date-value-in-scripting/m-p/1676766#M728474</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2020-02-18T16:44:38Z</dc:date>
    </item>
  </channel>
</rss>

