<?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: How to get lastmodifieddate in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-get-lastmodifieddate/m-p/710307#M255878</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;This won't check if a file exists: exists('$(vQVDPath)IDS_$(tableName).qvd') &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Use the filesize() function. It will return 0 if the file was not found:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Let vFileSize = FileSize('C:\MyDir\MyFile.qvd');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;If $(vFileSize)&amp;nbsp; = 0 then .... // file does not exist or its size really is zero bytes.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; 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>Thu, 19 Jun 2014 11:12:21 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2014-06-19T11:12:21Z</dc:date>
    <item>
      <title>How to get lastmodifieddate</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-lastmodifieddate/m-p/710306#M255877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Hi We are Loading QVDs&amp;nbsp; from Database based on the below code. We are doing an incremetal load here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not isnull(QVDCreateTime('$(vQVDPath)IDS_$(tableName).qvd')) then&lt;/P&gt;&lt;P&gt;LoadTime:&lt;/P&gt;&lt;P&gt;Load Max(LastModifiedDate) as LastModifiedDate // Or max(CreatedDate)&lt;/P&gt;&lt;P&gt;From $(vQVDPath)IDS_$(tableName).qvd (qvd);&lt;/P&gt;&lt;P&gt;Let vLastExecTime = timestamp(peek('LastModifiedDate',0,'LoadTime'),'YYYY-MM-DD hh:mm:ss');&lt;/P&gt;&lt;P&gt;//Let LastModifiedTimestamp = '$(vLastExecTime)';&lt;/P&gt;&lt;P&gt;Drop Table LoadTime;&lt;/P&gt;&lt;P&gt;ELSE&lt;/P&gt;&lt;P&gt;&amp;nbsp; Call FullTableLoad(tableName);&lt;/P&gt;&lt;P&gt;&amp;nbsp; EXIT SUB;&lt;/P&gt;&lt;P&gt;end if;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to this Code If the QVD is not Available then we are doing a Full Load.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now what We have Changed is &lt;/P&gt;&lt;P&gt;If the QVD is Available and the No of Records in QVD is zero&amp;nbsp; then again it has to do full load. and also we need to show&amp;nbsp; the LastModifieddate.&lt;/P&gt;&lt;P&gt;i Have changed the code like this but i am getting lastmodifieddate is 0. Why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not isnull(QVDCreateTime('$(vQVDPath)IDS_$(tableName).qvd')) or ((exists('$(vQVDPath)IDS_$(tableName).qvd') and QvdNoOfRecords('$(vQVDPath)IDS_$(tableName).qvd')=0)) then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LoadTime:&lt;/P&gt;&lt;P&gt;Load Max(LastModifiedDate) as LastModifiedDate // Or max(CreatedDate)&lt;/P&gt;&lt;P&gt;From $(vQVDPath)IDS_$(tableName).qvd (qvd);&lt;/P&gt;&lt;P&gt;Let vLastExecTime = timestamp(peek('LastModifiedDate',0,'LoadTime'),'YYYY-MM-DD hh:mm:ss');&lt;/P&gt;&lt;P&gt;//Let LastModifiedTimestamp = '$(vLastExecTime)';&lt;/P&gt;&lt;P&gt;Drop Table LoadTime;&lt;/P&gt;&lt;P&gt;ELSE&lt;/P&gt;&lt;P&gt;&amp;nbsp; Call FullTableLoad(tableName);&lt;/P&gt;&lt;P&gt;&amp;nbsp; EXIT SUB;&lt;/P&gt;&lt;P&gt;end if;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jun 2014 09:13:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-lastmodifieddate/m-p/710306#M255877</guid>
      <dc:creator />
      <dc:date>2014-06-19T09:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to get lastmodifieddate</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-lastmodifieddate/m-p/710307#M255878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;This won't check if a file exists: exists('$(vQVDPath)IDS_$(tableName).qvd') &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Use the filesize() function. It will return 0 if the file was not found:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Let vFileSize = FileSize('C:\MyDir\MyFile.qvd');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;If $(vFileSize)&amp;nbsp; = 0 then .... // file does not exist or its size really is zero bytes.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; 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>Thu, 19 Jun 2014 11:12:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-lastmodifieddate/m-p/710307#M255878</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-06-19T11:12:21Z</dc:date>
    </item>
  </channel>
</rss>

