<?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: second last max date in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/second-last-max-date/m-p/1827845#M15406</link>
    <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/41596"&gt;@capriconuser&lt;/a&gt;&amp;nbsp; &amp;nbsp;after creating date, perform below load.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;max:
LOAD date(max(Date)) as max_date, date(max(Date,2)) as second_max_date
Load fieldvalue('Max_Date', recno()) as Date
autogenerate fieldvaluecount('Max_Date');&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now you can use below below variables&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Let vMaxDate = floor(Peek('max_date', 0, 'max'));
Let vSecondMaxDate = Floor(Peek('second_max_date', 0, 'max'));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 10 Aug 2021 22:15:43 GMT</pubDate>
    <dc:creator>Kushal_Chawda</dc:creator>
    <dc:date>2021-08-10T22:15:43Z</dc:date>
    <item>
      <title>second last max date</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/second-last-max-date/m-p/1827653#M15398</link>
      <description>&lt;P&gt;Hi my script is&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is multiple files in folder like this&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Abc-Jan-2021.xlsx
Abc-Feb-2021.xlsx
Abc-Mar-2021.xlsx&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;now I successfully extract Month , Year and Date from these file name like this&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Table1:
LOAD DisplayName as FullName, 
      EmailID,
     Trim(Replace(FileBaseName(),'Abc-','')) as Mail_Date
FROM
[data\Usage\Abc-*.xlsx]
(ooxml, embedded labels, table is Sheet1);

Date_Table:
Load *,
MonthEnd(MakeDate(Right(File_Month, 4), Num(Month(Date#(Left(File_Month, 3), 'MMM'))))) as Max_Date
Resident Table1;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;now here i extract &lt;STRONG&gt;Max_Date&lt;/STRONG&gt; from files.. and then i store in varaible like this&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Let vMaxDate = Num(Floor(Peek('Max_Date', 0, 'Date_Table')));
Let vSecondMaxDate = Num(Floor(Peek('Max_Date', -1, 'Date_Table')));&lt;/LI-CODE&gt;&lt;P&gt;now i want to extract second last max date.. i.e. in these files&amp;nbsp;&lt;/P&gt;&lt;P&gt;max date is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;31-03-2021
and second last max date is 
28-02-2021&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so how i get second last max date?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Aug 2021 08:41:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/second-last-max-date/m-p/1827653#M15398</guid>
      <dc:creator>capriconuser</dc:creator>
      <dc:date>2021-08-10T08:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: second last max date</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/second-last-max-date/m-p/1827658#M15399</link>
      <description>&lt;P&gt;HI&lt;/P&gt;&lt;P&gt;It will give the second max date&lt;/P&gt;&lt;P&gt;Load Max(Max_Date,2) as SecondMaxDate Resident Table1;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Aug 2021 08:58:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/second-last-max-date/m-p/1827658#M15399</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2021-08-10T08:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: second last max date</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/second-last-max-date/m-p/1827845#M15406</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/41596"&gt;@capriconuser&lt;/a&gt;&amp;nbsp; &amp;nbsp;after creating date, perform below load.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;max:
LOAD date(max(Date)) as max_date, date(max(Date,2)) as second_max_date
Load fieldvalue('Max_Date', recno()) as Date
autogenerate fieldvaluecount('Max_Date');&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now you can use below below variables&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Let vMaxDate = floor(Peek('max_date', 0, 'max'));
Let vSecondMaxDate = Floor(Peek('second_max_date', 0, 'max'));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Aug 2021 22:15:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/second-last-max-date/m-p/1827845#M15406</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2021-08-10T22:15:43Z</dc:date>
    </item>
  </channel>
</rss>

