<?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: Script: Getting rid of records depending on date in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Script-Getting-rid-of-records-depending-on-date/m-p/996045#M964112</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A couple people have mentioned using:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'courier new', courier;"&gt;where ValidToDate=monthend(ValidToDate)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;which I think is on the right track. However MonthEnd returns a timestamp corresponding to 23:59:59 so I think the comparison should be:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'courier new', courier;"&gt;where ValidToDate=floor(monthend(ValidToDate))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;or perhaps:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'courier new', courier;"&gt;where ValidToDate=date(floor(monthend(ValidToDate)))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;-Rob&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Oct 2015 14:00:14 GMT</pubDate>
    <dc:creator>rwunderlich</dc:creator>
    <dc:date>2015-10-16T14:00:14Z</dc:date>
    <item>
      <title>Script: Getting rid of records depending on date</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Getting-rid-of-records-depending-on-date/m-p/996039#M964106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good afternoon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I´ve got data like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PersonnelNr: 4711&lt;/P&gt;&lt;P&gt;Name: Kevin Costner&lt;/P&gt;&lt;P&gt;CostCenter: 9876&lt;/P&gt;&lt;P&gt;LastDayOfTheMonth: 30.06.2015&lt;/P&gt;&lt;P&gt;ValidToDate: 15.06.2015&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PersonnelNr: 4711&lt;/P&gt;&lt;P&gt;Name: Kevin Costner&lt;/P&gt;&lt;P&gt;CostCenter: 9876&lt;/P&gt;&lt;P&gt;LastDayOfTheMonth: 30.06.2015&lt;/P&gt;&lt;P&gt;ValidToDate: 30.06.2015&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The records cover several years. How can I get rid of the records that have a ValidToDate that is not the last day of the month? In the example above, I would keep only the second record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Oct 2015 13:21:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Getting-rid-of-records-depending-on-date/m-p/996039#M964106</guid>
      <dc:creator />
      <dc:date>2015-10-16T13:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: Script: Getting rid of records depending on date</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Getting-rid-of-records-depending-on-date/m-p/996040#M964107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style: inherit; font-weight: inherit; font-size: 10pt; line-height: 1.5em;"&gt;if(validtodate=Date(MonthEnd(validtodate)),validtodate) as validtodate&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Oct 2015 13:28:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Getting-rid-of-records-depending-on-date/m-p/996040#M964107</guid>
      <dc:creator>settu_periasamy</dc:creator>
      <dc:date>2015-10-16T13:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: Script: Getting rid of records depending on date</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Getting-rid-of-records-depending-on-date/m-p/996041#M964108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can either Group the data in script&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;PersonnelNr,&lt;/P&gt;&lt;P&gt;Name,&lt;/P&gt;&lt;P&gt;CostCenter,&lt;/P&gt;&lt;P&gt;LastDayofMonth&lt;/P&gt;&lt;P&gt;max(ValidToDate)&lt;/P&gt;&lt;P&gt;from&lt;/P&gt;&lt;P&gt;Group by&lt;/P&gt;&lt;P&gt;PersonnelNr,&lt;/P&gt;&lt;P&gt;Name,&lt;/P&gt;&lt;P&gt;CostCenter,&lt;/P&gt;&lt;P&gt;LastDayofMonth&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or you just load the data with the where clause (works only if there is only 1 record per PersonnelNr for validtodate on the last day of month). if a Person can be more than onces in that list till end of month, you should do the group&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TmpData:&lt;/P&gt;&lt;P&gt;load *&lt;/P&gt;&lt;P&gt;resident Data&lt;/P&gt;&lt;P&gt;where ValidToDate=monthend(ValidToDate)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table Data&lt;/P&gt;&lt;P&gt;ren table TmpData to Data&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Oct 2015 13:31:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Getting-rid-of-records-depending-on-date/m-p/996041#M964108</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-16T13:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: Script: Getting rid of records depending on date</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Getting-rid-of-records-depending-on-date/m-p/996042#M964109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks but I want to actually eliminate the first record so as to avoid having to always use count distinct. Any suggestions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Oct 2015 13:46:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Getting-rid-of-records-depending-on-date/m-p/996042#M964109</guid>
      <dc:creator />
      <dc:date>2015-10-16T13:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: Script: Getting rid of records depending on date</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Getting-rid-of-records-depending-on-date/m-p/996043#M964110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;using the following would eliminate the first record&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TmpData:&lt;/P&gt;&lt;P&gt;load *&lt;/P&gt;&lt;P&gt;resident Data&lt;/P&gt;&lt;P&gt;where ValidToDate=date(monthend(ValidToDate))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table Data&lt;/P&gt;&lt;P&gt;rename table TmpData to Data&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Oct 2015 13:50:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Getting-rid-of-records-depending-on-date/m-p/996043#M964110</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-16T13:50:34Z</dc:date>
    </item>
    <item>
      <title>Re: Script: Getting rid of records depending on date</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Getting-rid-of-records-depending-on-date/m-p/996044#M964111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then you can try the Rudolf Suggestion..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Oct 2015 13:54:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Getting-rid-of-records-depending-on-date/m-p/996044#M964111</guid>
      <dc:creator>settu_periasamy</dc:creator>
      <dc:date>2015-10-16T13:54:23Z</dc:date>
    </item>
    <item>
      <title>Re: Script: Getting rid of records depending on date</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Getting-rid-of-records-depending-on-date/m-p/996045#M964112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A couple people have mentioned using:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'courier new', courier;"&gt;where ValidToDate=monthend(ValidToDate)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;which I think is on the right track. However MonthEnd returns a timestamp corresponding to 23:59:59 so I think the comparison should be:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'courier new', courier;"&gt;where ValidToDate=floor(monthend(ValidToDate))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;or perhaps:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'courier new', courier;"&gt;where ValidToDate=date(floor(monthend(ValidToDate)))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;-Rob&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Oct 2015 14:00:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Getting-rid-of-records-depending-on-date/m-p/996045#M964112</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2015-10-16T14:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: Script: Getting rid of records depending on date</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Getting-rid-of-records-depending-on-date/m-p/996046#M964113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rudolf. I didn´t explain myself well, apologies. I could have records as per below and would want to keep records 2 and 3 but not 1:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rec1&lt;/P&gt;&lt;P&gt;PersonnelNr: 4711&lt;/P&gt;&lt;P&gt;Name: Kevin Costner&lt;/P&gt;&lt;P&gt;CostCenter: 9876&lt;/P&gt;&lt;P&gt;LastDayOfTheMonth: 30.06.2015&lt;/P&gt;&lt;P&gt;ValidToDate: 15.06.2015&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rec2&lt;/P&gt;&lt;P&gt;PersonnelNr: 4711&lt;/P&gt;&lt;P&gt;Name: Kevin Costner&lt;/P&gt;&lt;P&gt;CostCenter: 9876&lt;/P&gt;&lt;P&gt;LastDayOfTheMonth: 30.06.2015&lt;/P&gt;&lt;P&gt;ValidToDate: 30.06.2015&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rec3&lt;/P&gt;&lt;P&gt;PersonnelNr: 4711&lt;/P&gt;&lt;P&gt;Name: Kevin Costner&lt;/P&gt;&lt;P&gt;CostCenter: 9876&lt;/P&gt;&lt;P&gt;LastDayOfTheMonth: 31.05.2015&lt;/P&gt;&lt;P&gt;ValidToDate: 30.06.2015&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Oct 2015 14:06:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Getting-rid-of-records-depending-on-date/m-p/996046#M964113</guid>
      <dc:creator />
      <dc:date>2015-10-16T14:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: Script: Getting rid of records depending on date</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Getting-rid-of-records-depending-on-date/m-p/996047#M964114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;that's exactly what this script is doing (thks Rob for the correction!)&lt;/P&gt;&lt;P&gt;in your example the Rec 2 and 3 will be kept!&lt;/P&gt;&lt;P&gt;give it a try!@&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TmpData:&lt;/P&gt;&lt;P&gt;load *&lt;/P&gt;&lt;P&gt;resident Data&lt;/P&gt;&lt;P&gt;where ValidToDate=&lt;SPAN style="color: #3d3d3d; font-family: Courier New;"&gt;floor(monthend(ValidToDate))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; @robwunderöich&lt;/P&gt;&lt;P&gt;drop table Data&lt;/P&gt;&lt;P&gt;ren table TmpData to Data&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Oct 2015 14:16:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Getting-rid-of-records-depending-on-date/m-p/996047#M964114</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-16T14:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: Script: Getting rid of records depending on date</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Getting-rid-of-records-depending-on-date/m-p/996048#M964115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Oct 2015 14:50:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Getting-rid-of-records-depending-on-date/m-p/996048#M964115</guid>
      <dc:creator />
      <dc:date>2015-10-16T14:50:10Z</dc:date>
    </item>
  </channel>
</rss>

