<?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>idea Identifying last n working days in script via master calendar in Suggest an Idea</title>
    <link>https://community.qlik.com/t5/Suggest-an-Idea/Identifying-last-n-working-days-in-script-via-master-calendar/idi-p/1571167</link>
    <description>&lt;P&gt;I was working to identify records with dates in last 5 working days (From max date in transactions).&amp;nbsp; This logic could then simplify set-analysis and enable a faster end-user experience.&amp;nbsp; Consider adding this in your calendar script:&amp;nbsp; if(TempDate&amp;gt;= Date(FirstWorkDate('$(vMaxDate)',5)), 1,0) as LastFiveWorkDays,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Temp:&lt;BR /&gt;Load&lt;BR /&gt;min(startdate) as minDate,&lt;BR /&gt;max(startdate) as maxDate&lt;BR /&gt;Resident Transactions;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Let varMinDate = Num(Peek('minDate', 0, 'Temp'));&lt;BR /&gt;Let varMaxDate = Num(Peek('maxDate', 0, 'Temp'));&lt;/P&gt;
&lt;P&gt;DROP Table Temp;&lt;BR /&gt;&lt;BR /&gt;TempCalendar:&lt;BR /&gt;LOAD distinct&lt;BR /&gt;$(varMinDate) + Iterno()-1 As Num,&lt;BR /&gt;Date($(varMinDate) + IterNo() - 1) as TempDate&lt;BR /&gt;AutoGenerate 1 While '$(varMinDate)' + IterNo() -1 &amp;lt;= '$(varMaxDate)';&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;MasterCalendar:&lt;BR /&gt;Load&lt;BR /&gt;TempDate as startdate,&lt;BR /&gt;if(TempDate&amp;gt;= Date(FirstWorkDate('$(vMaxDate)',5)), 1,0) as LastFiveWorkDays,&lt;BR /&gt;Date('$(vMaxDate)') as MaxDate&lt;BR /&gt;Resident TempCalendar&lt;BR /&gt;Order By TempDate ASC;&lt;BR /&gt;Drop Table TempCalendar;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Nov 2020 15:12:24 GMT</pubDate>
    <dc:creator>sandeep_sarawgi</dc:creator>
    <dc:date>2020-11-25T15:12:24Z</dc:date>
    <item>
      <title>Re: Identifying last n working days in script via master calendar</title>
      <link>https://community.qlik.com/t5/Suggest-an-Idea/Identifying-last-n-working-days-in-script-via-master-calendar/idc-p/1642984#M908</link>
      <description>Archiving - This is a discussion, not an idea.</description>
      <pubDate>Tue, 05 Nov 2019 10:12:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Suggest-an-Idea/Identifying-last-n-working-days-in-script-via-master-calendar/idc-p/1642984#M908</guid>
      <dc:creator>John_Teichman</dc:creator>
      <dc:date>2019-11-05T10:12:14Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying last n working days in script via master calendar - Status changed to: Archived</title>
      <link>https://community.qlik.com/t5/Suggest-an-Idea/Identifying-last-n-working-days-in-script-via-master-calendar/idc-p/1642985#M909</link>
      <description />
      <pubDate>Tue, 05 Nov 2019 10:12:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Suggest-an-Idea/Identifying-last-n-working-days-in-script-via-master-calendar/idc-p/1642985#M909</guid>
      <dc:creator>John_Teichman</dc:creator>
      <dc:date>2019-11-05T10:12:25Z</dc:date>
    </item>
  </channel>
</rss>

