<?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 ApplyMap - How do I get the last record in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/ApplyMap-How-do-I-get-the-last-record/m-p/1560041#M40798</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm using the ApplyMap function to get a record from the order timelog line using the order number.&lt;/P&gt;&lt;P&gt;The ordertimelog file contains many records for each order and I want to get the last one.&lt;/P&gt;&lt;P&gt;My ApplyMap works but I always get the first ordertimelog record in sequence &amp;nbsp;instead of the last one.&lt;/P&gt;&lt;P&gt;How should I set up the sqript to get the last record from the Timelog file?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is how my sqript looks today:&lt;/P&gt;&lt;P&gt;MapReportedByToOrder:&lt;BR /&gt;MAPPING LOAD&amp;nbsp; StringKey1 as TaskOrderNumber,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; StringKey5 as TaskReportedBy;&lt;/P&gt;&lt;P&gt;SQL SELECT * FROM "MyL_PROD_220".OTSDATA.TimeLog;&lt;/P&gt;&lt;P&gt;-------------------------&lt;/P&gt;&lt;P&gt;LOAD LONumber as OrderNumber,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Network,&lt;/P&gt;&lt;P&gt;ApplyMap('MapReportedByToOrder', LONumber, null()) as OrderReportedBy;&lt;/P&gt;&lt;P&gt;SQL SELECT *FROM "MyL_PROD_220".OTSDATA.LOHeader;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 21:11:43 GMT</pubDate>
    <dc:creator>magnusrydberg</dc:creator>
    <dc:date>2024-11-16T21:11:43Z</dc:date>
    <item>
      <title>ApplyMap - How do I get the last record</title>
      <link>https://community.qlik.com/t5/App-Development/ApplyMap-How-do-I-get-the-last-record/m-p/1560041#M40798</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm using the ApplyMap function to get a record from the order timelog line using the order number.&lt;/P&gt;&lt;P&gt;The ordertimelog file contains many records for each order and I want to get the last one.&lt;/P&gt;&lt;P&gt;My ApplyMap works but I always get the first ordertimelog record in sequence &amp;nbsp;instead of the last one.&lt;/P&gt;&lt;P&gt;How should I set up the sqript to get the last record from the Timelog file?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is how my sqript looks today:&lt;/P&gt;&lt;P&gt;MapReportedByToOrder:&lt;BR /&gt;MAPPING LOAD&amp;nbsp; StringKey1 as TaskOrderNumber,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; StringKey5 as TaskReportedBy;&lt;/P&gt;&lt;P&gt;SQL SELECT * FROM "MyL_PROD_220".OTSDATA.TimeLog;&lt;/P&gt;&lt;P&gt;-------------------------&lt;/P&gt;&lt;P&gt;LOAD LONumber as OrderNumber,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Network,&lt;/P&gt;&lt;P&gt;ApplyMap('MapReportedByToOrder', LONumber, null()) as OrderReportedBy;&lt;/P&gt;&lt;P&gt;SQL SELECT *FROM "MyL_PROD_220".OTSDATA.LOHeader;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 21:11:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/ApplyMap-How-do-I-get-the-last-record/m-p/1560041#M40798</guid>
      <dc:creator>magnusrydberg</dc:creator>
      <dc:date>2024-11-16T21:11:43Z</dc:date>
    </item>
    <item>
      <title>Re: ApplyMap - How do I get the last record</title>
      <link>https://community.qlik.com/t5/App-Development/ApplyMap-How-do-I-get-the-last-record/m-p/1560056#M40799</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using applymap() we can retrieve very first record only.&lt;/P&gt;&lt;P&gt;You can use peek(0 function to get the table values based on the positions.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2019 12:14:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/ApplyMap-How-do-I-get-the-last-record/m-p/1560056#M40799</guid>
      <dc:creator>Somasundaram</dc:creator>
      <dc:date>2019-03-22T12:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: ApplyMap - How do I get the last record</title>
      <link>https://community.qlik.com/t5/App-Development/ApplyMap-How-do-I-get-the-last-record/m-p/1560058#M40800</link>
      <description>&lt;P&gt;You have two options&lt;/P&gt;&lt;P&gt;1) Use Group By to bring the max TaskReportedBy&lt;/P&gt;&lt;PRE&gt;MapReportedByToOrder:
MAPPING LOAD  StringKey1 as TaskOrderNumber,
       &lt;FONT color="#FF0000"&gt;Max(&lt;/FONT&gt;StringKey5&lt;FONT color="#FF0000"&gt;)&lt;/FONT&gt; as TaskReportedBy
&lt;FONT color="#FF0000"&gt;Group By StringKey1&lt;/FONT&gt;;

SQL SELECT * FROM "MyL_PROD_220".OTSDATA.TimeLog;&lt;/PRE&gt;&lt;P&gt;2) Use Order by to sort TaskReportedBy in descending order&lt;/P&gt;&lt;PRE&gt;MapReportedByToOrder:
MAPPING LOAD  StringKey1 as TaskOrderNumber,
       StringKey5 as TaskReportedBy;

SQL SELECT * FROM "MyL_PROD_220".OTSDATA.TimeLog &lt;FONT color="#FF0000"&gt;ORDER BY StrinkKey5 desc&lt;/FONT&gt;;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Mar 2019 12:17:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/ApplyMap-How-do-I-get-the-last-record/m-p/1560058#M40800</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-03-22T12:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: ApplyMap - How do I get the last record</title>
      <link>https://community.qlik.com/t5/App-Development/ApplyMap-How-do-I-get-the-last-record/m-p/1560182#M40810</link>
      <description>Thanks a lot!&lt;BR /&gt;It works!&lt;BR /&gt;// Magnus</description>
      <pubDate>Fri, 22 Mar 2019 15:23:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/ApplyMap-How-do-I-get-the-last-record/m-p/1560182#M40810</guid>
      <dc:creator>magnusrydberg</dc:creator>
      <dc:date>2019-03-22T15:23:27Z</dc:date>
    </item>
  </channel>
</rss>

