<?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: Display the last 12 dates via Script Load in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Display-the-last-12-dates-via-Script-Load/m-p/1781968#M1209572</link>
    <description>&lt;P&gt;Yes but every month it will add a new date. So technically i have more dates after 9/30/2020 i just made some test data. So i have 10/31, 11/30, 12/31 (2020), and 1/31/2021. At the end of Feb i will have 2/28/2021. I just wanted it to keep the last 12 dates in there as it grows.&lt;/P&gt;</description>
    <pubDate>Thu, 11 Feb 2021 12:27:30 GMT</pubDate>
    <dc:creator>alalko245</dc:creator>
    <dc:date>2021-02-11T12:27:30Z</dc:date>
    <item>
      <title>Display the last 12 dates via Script Load</title>
      <link>https://community.qlik.com/t5/QlikView/Display-the-last-12-dates-via-Script-Load/m-p/1781751#M1209534</link>
      <description>&lt;P&gt;Hi this is my first time posting here so forgive me if this isn't the right spot.&amp;nbsp; Basically I have a QVD file that saves and appends the last day of every month. I have been doing this since 2018 and realized now I do not need to store this much data and I think storing the last 12 (and also the current date as this runs daily) would be fine.&lt;/P&gt;&lt;P&gt;I've been looking on the forum and found a few solutions which only remove SOME of the old data and don't display the full previous 12 months.&amp;nbsp; It would only display 7 or 8 of the previous months using this formula:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where monthstart([SNAPSHOT DATE]) &amp;gt;= monthstart(addmonths(today(),-12))&lt;/P&gt;&lt;P&gt;I will attach some screenshots of what i prefer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2021 19:07:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Display-the-last-12-dates-via-Script-Load/m-p/1781751#M1209534</guid>
      <dc:creator>alalko245</dc:creator>
      <dc:date>2021-02-10T19:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: Display the last 12 dates via Script Load</title>
      <link>https://community.qlik.com/t5/QlikView/Display-the-last-12-dates-via-Script-Load/m-p/1781755#M1209535</link>
      <description>&lt;P&gt;So i noticed if i use the script "Where monthstart([SNAPSHOT DATE]) &amp;gt;= monthstart(addmonths(today(),-18))"&lt;/P&gt;&lt;P&gt;It shows the last 12 months but i have no idea. It may be worth noting that while i tried to save the last day of every month some issues occurred and you'll notice that i am missing June 2020 and i missed Dec 2019 but i saved Jan 2nd 2020 to get as close as i could. I also missed Feb. I'm not sure if this is impacting my script, i am very new to this. I just want it to load the last 12 dates (and also todays current date).&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2021 19:34:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Display-the-last-12-dates-via-Script-Load/m-p/1781755#M1209535</guid>
      <dc:creator>alalko245</dc:creator>
      <dc:date>2021-02-10T19:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: Display the last 12 dates via Script Load</title>
      <link>https://community.qlik.com/t5/QlikView/Display-the-last-12-dates-via-Script-Load/m-p/1781824#M1209546</link>
      <description>&lt;P&gt;So, u want the last 12 Dates in the list and not the last 12 months date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One solution is,&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;tab1:
LOAD * INLINE [
    SNAPSHOT DATE
    6/30/2019
    7/31/2019
    8/31/2019
    9/30/2019
    10/31/2019
    11/30/2019
    12/31/2019
    1/2/2020
    1/31/2020
    3/31/2020
    4/30/2020
    5/31/2020
    7/1/2020
    8/31/2020
    9/30/2020
    2/10/2021
];

tab2:
LOAD *, RowNo() As ID
Resident tab1
Where RowNo() &amp;lt; 12
Order By [SNAPSHOT DATE] Desc;

Drop Table tab1;&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 11 Feb 2021 04:03:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Display-the-last-12-dates-via-Script-Load/m-p/1781824#M1209546</guid>
      <dc:creator>Saravanan_Desingh</dc:creator>
      <dc:date>2021-02-11T04:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: Display the last 12 dates via Script Load</title>
      <link>https://community.qlik.com/t5/QlikView/Display-the-last-12-dates-via-Script-Load/m-p/1781826#M1209547</link>
      <description>&lt;P&gt;Output:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="commQV86.PNG" style="width: 155px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/48878i3317FB0E20C361AC/image-size/large?v=v2&amp;amp;px=999" role="button" title="commQV86.PNG" alt="commQV86.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2021 04:03:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Display-the-last-12-dates-via-Script-Load/m-p/1781826#M1209547</guid>
      <dc:creator>Saravanan_Desingh</dc:creator>
      <dc:date>2021-02-11T04:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: Display the last 12 dates via Script Load</title>
      <link>https://community.qlik.com/t5/QlikView/Display-the-last-12-dates-via-Script-Load/m-p/1781968#M1209572</link>
      <description>&lt;P&gt;Yes but every month it will add a new date. So technically i have more dates after 9/30/2020 i just made some test data. So i have 10/31, 11/30, 12/31 (2020), and 1/31/2021. At the end of Feb i will have 2/28/2021. I just wanted it to keep the last 12 dates in there as it grows.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2021 12:27:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Display-the-last-12-dates-via-Script-Load/m-p/1781968#M1209572</guid>
      <dc:creator>alalko245</dc:creator>
      <dc:date>2021-02-11T12:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: Display the last 12 dates via Script Load</title>
      <link>https://community.qlik.com/t5/QlikView/Display-the-last-12-dates-via-Script-Load/m-p/1782044#M1209585</link>
      <description>&lt;P&gt;My code will pull the last 12 dates.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Where RowNo() &amp;lt; 12&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 11 Feb 2021 16:16:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Display-the-last-12-dates-via-Script-Load/m-p/1782044#M1209585</guid>
      <dc:creator>Saravanan_Desingh</dc:creator>
      <dc:date>2021-02-11T16:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: Display the last 12 dates via Script Load</title>
      <link>https://community.qlik.com/t5/QlikView/Display-the-last-12-dates-via-Script-Load/m-p/1782075#M1209588</link>
      <description>&lt;P&gt;I'm not sure how to implement this. I have a qvx that loads in about 100 fields. and then i append&amp;nbsp; to the QVD if the snapshot date is the last of the month. I tried putting your code below in front of my STORE procedure but it didn't work. I am afraid to add too much and i am not familiar with drop.&amp;nbsp;&lt;/P&gt;&lt;P&gt;LOAD *, RowNo() As ID Resident tab1 Where RowNo() &amp;lt; 12 Order By [SNAPSHOT DATE] Desc;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to use something like this to get the same result?&amp;nbsp;&lt;SPAN&gt;Where monthstart([SNAPSHOT DATE]) &amp;gt;= monthstart(addmonths(today(),-12))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know enough to get this implemented but it's not giving me the dates i'd expect&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2021 17:56:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Display-the-last-12-dates-via-Script-Load/m-p/1782075#M1209588</guid>
      <dc:creator>alalko245</dc:creator>
      <dc:date>2021-02-11T17:56:27Z</dc:date>
    </item>
    <item>
      <title>Re: Display the last 12 dates via Script Load</title>
      <link>https://community.qlik.com/t5/QlikView/Display-the-last-12-dates-via-Script-Load/m-p/1782166#M1209606</link>
      <description>&lt;LI-CODE lang="markup"&gt;tab1:
LOAD * INLINE [
    SNAPSHOT DATE
    6/30/2019
    7/31/2019
    8/31/2019
    9/30/2019
    10/31/2019
    11/30/2019
    12/31/2019
    1/2/2020
    1/31/2020
    3/31/2020
    4/30/2020
    5/31/2020
    7/1/2020
    8/31/2020
    9/30/2020
    2/10/2021
];

tab2:
NoConcatenate
LOAD [SNAPSHOT DATE] As LeastDate, RowNo() As ID
Resident tab1
Order By [SNAPSHOT DATE] Desc;

Right Join(tab2)
LOAD 12 As ID
AutoGenerate 1;

Let vLeastDate=Peek('LeastDate');

Trace **vLeastDate='$(vLeastDate)';

Drop Table tab1, tab2;&lt;/LI-CODE&gt;&lt;P&gt;The above code will help you to get the Least Date (12th date from the end). Use the below code to filter the data.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Where monthstart([SNAPSHOT DATE]) &amp;gt;= '$(LeastDate)';&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2021 00:28:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Display-the-last-12-dates-via-Script-Load/m-p/1782166#M1209606</guid>
      <dc:creator>Saravanan_Desingh</dc:creator>
      <dc:date>2021-02-12T00:28:32Z</dc:date>
    </item>
  </channel>
</rss>

