<?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: Max Date in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Max-Date/m-p/1652180#M48664</link>
    <description>&lt;P&gt;Thank you Vu Nguyen. I was able to modify Date# as below:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;// Loading data from QVD
SRO:
LOAD 
	[Form Ref No],
	[Form Name],
        Date(Date#(CompletionDate,'DD/MM/YYYY hh:mm:ss TT'),'DD/MM/YYYY hh:mm:ss TT') as CompletionDate
FROM [lib://GS_Folder/SRO.qvd] (qvd);

// Find last modified date
Last_Updated_Date:
load max (CompletionDate) as Maxdate
resident SRO;

// Store last modified date to a variable
Let Last_Updated_Date=peek('Maxdate',0,'Last_Updated_Date');&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;When I try to add it to below scripts it says "'Date#' is not a recognized built-in function name".&lt;BR /&gt;Can you advise how should I modify the "CompletionDate" for the below scripts:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;// Load incremental data
Incremental:
LOAD 
[Form Ref No],
[Form Name],
CompletionDate;

SELECT
"Form Ref No",
"Form Name", 
CompletionDate 
FROM TABLE where CompletionDate &amp;gt; $(Last_Updated_Date);

// Concatenate with QVD
Concatenate
LOAD 
[Form Ref No],
[Form Name],
CompletionDate
FROM [lib://GS_Folder/SRO.qvd] (qvd);

// Replace old QVD file
Store Incremental into [lib://GS_Folder/SRO.qvd] (qvd);

// Drop Incremental Table
Drop table Incremental;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Nov 2019 09:50:12 GMT</pubDate>
    <dc:creator>user8</dc:creator>
    <dc:date>2019-11-28T09:50:12Z</dc:date>
    <item>
      <title>Max Date</title>
      <link>https://community.qlik.com/t5/App-Development/Max-Date/m-p/1651252#M48579</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have an incremental load script:&lt;/P&gt;&lt;P&gt;SRO:&lt;BR /&gt;LOAD&lt;BR /&gt;[Form Ref No],&lt;BR /&gt;[Form Name],&lt;BR /&gt;CompletionDate&lt;BR /&gt;FROM [lib://GS_Folder/SRO.qvd] (qvd);&lt;/P&gt;&lt;P&gt;// Find last modified date&lt;BR /&gt;Last_Updated_Date:&lt;BR /&gt;load max (CompletionDate) as Maxdate&lt;BR /&gt;resident SRO;&lt;/P&gt;&lt;P&gt;// Store last modified date to a variable&lt;BR /&gt;Let Last_Updated_Date=peek('Maxdate',0,'Last_Updated_Date');&lt;/P&gt;&lt;P&gt;The CompletionDate data is in the format of 21/11/2019 5:06:29 PM.&lt;BR /&gt;Will the "load max (CompletionDate) as Maxdate" command work here?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm asking as it does not seems to identify the CompletionDate and the incremental data are not being pulled from DB to the QVD file.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Appreciate any help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 19:35:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Max-Date/m-p/1651252#M48579</guid>
      <dc:creator>user8</dc:creator>
      <dc:date>2024-11-16T19:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: Max Date</title>
      <link>https://community.qlik.com/t5/App-Development/Max-Date/m-p/1651809#M48616</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You should check field &lt;EM&gt;CompletionDate&lt;/EM&gt; in Data Model Viewer to see if it contains tags &lt;EM&gt;$numeric $timestamp.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="test.png" style="width: 315px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/24525i0FA3578C1D76520C/image-size/large?v=v2&amp;amp;px=999" role="button" title="test.png" alt="test.png" /&gt;&lt;/span&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;If the field has tags &lt;EM&gt;$ascii $text&lt;/EM&gt; instead, you should convert it to date type. For example&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;SRO:
LOAD
[Form Ref No],
[Form Name],
Date(Date#(CompletionDate,'DD/MM/YYYY hh:mm:ss TT'),'DD/MM/YYYY hh:mm:ss TT') as CompletionDate
FROM [lib://GS_Folder/SRO.qvd] (qvd);&lt;/LI-CODE&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Vu Nguyen&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 10:17:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Max-Date/m-p/1651809#M48616</guid>
      <dc:creator>vunguyenq89</dc:creator>
      <dc:date>2019-11-27T10:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: Max Date</title>
      <link>https://community.qlik.com/t5/App-Development/Max-Date/m-p/1652180#M48664</link>
      <description>&lt;P&gt;Thank you Vu Nguyen. I was able to modify Date# as below:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;// Loading data from QVD
SRO:
LOAD 
	[Form Ref No],
	[Form Name],
        Date(Date#(CompletionDate,'DD/MM/YYYY hh:mm:ss TT'),'DD/MM/YYYY hh:mm:ss TT') as CompletionDate
FROM [lib://GS_Folder/SRO.qvd] (qvd);

// Find last modified date
Last_Updated_Date:
load max (CompletionDate) as Maxdate
resident SRO;

// Store last modified date to a variable
Let Last_Updated_Date=peek('Maxdate',0,'Last_Updated_Date');&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;When I try to add it to below scripts it says "'Date#' is not a recognized built-in function name".&lt;BR /&gt;Can you advise how should I modify the "CompletionDate" for the below scripts:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;// Load incremental data
Incremental:
LOAD 
[Form Ref No],
[Form Name],
CompletionDate;

SELECT
"Form Ref No",
"Form Name", 
CompletionDate 
FROM TABLE where CompletionDate &amp;gt; $(Last_Updated_Date);

// Concatenate with QVD
Concatenate
LOAD 
[Form Ref No],
[Form Name],
CompletionDate
FROM [lib://GS_Folder/SRO.qvd] (qvd);

// Replace old QVD file
Store Incremental into [lib://GS_Folder/SRO.qvd] (qvd);

// Drop Incremental Table
Drop table Incremental;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2019 09:50:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Max-Date/m-p/1652180#M48664</guid>
      <dc:creator>user8</dc:creator>
      <dc:date>2019-11-28T09:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: Max Date</title>
      <link>https://community.qlik.com/t5/App-Development/Max-Date/m-p/1652567#M48727</link>
      <description>&lt;P&gt;&lt;SPAN&gt;"'Date#' is not a recognized built-in function name" sounds like an error message in SQL Server rather than Qlik Sense. Did you use Date#() function in a SQL statement?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2019 08:53:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Max-Date/m-p/1652567#M48727</guid>
      <dc:creator>vunguyenq89</dc:creator>
      <dc:date>2019-11-29T08:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: Max Date</title>
      <link>https://community.qlik.com/t5/App-Development/Max-Date/m-p/1653902#M48856</link>
      <description>&lt;P&gt;I'm using MS SQL DB. The CompletionDate column format is 21/11/2019 5:06:29 PM. I think Maxdate will not recognise this format&amp;nbsp;hence I'm converting it to 21/11/2019 using below script:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;LOAD &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;.....&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;Date(Date#(CompletionDate,'DD/MM/YYYY hh:mm:ss TT'),'DD/MM/YYYY') as CompletionDate;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;.....&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;SELECT&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;.....&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;FORMAT (getdate(), 'dd/MM/yyyy') as CompletionDate &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;FROM Table where CompletionDate &amp;gt; $(Last_Updated_Date);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;When I run it, it says&lt;/P&gt;&lt;P&gt;The following error occurred:&lt;BR /&gt;Connector reply error: SQL##f - SqlState: 42000, ErrorCode: 102, ErrorMsg: Incorrect syntax near '&amp;gt;'.,&lt;/P&gt;&lt;P&gt;I suspect it cannot read $(Last_Updated_Date) as when I change to "where CompletionDate &amp;gt; 21/11/2019;" it was able to run fine.&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;P&gt;Below is the full script:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;// Loading data from QVD
SRO:
LOAD 
[Form Ref No],
[Form Name],
Date(Date#(CompletionDate,'DD/MM/YYYY hh:mm:ss TT'),'DD/MM/YYYY') as CompletionDate
FROM [lib://SRO.qvd] (qvd);

// Find last modified date
Last_Updated_Date:
load max (CompletionDate) as Maxdate
resident SRO;

// Store last modified date to a variable
Let Last_Updated_Date=peek('Maxdate',0,'Last_Updated_Date');

// Delete Table SRO
Drop table SRO;

LIB CONNECT TO 'SQL_SRO_ODBC';

// Load incremental data
Incremental:
LOAD 
[Form Ref No],
[Form Name],
Date(Date#(CompletionDate,'DD/MM/YYYY hh:mm:ss TT'),'DD/MM/YYYY') as CompletionDate;

SELECT
"Form Ref No",
"Form Name", 
FORMAT (getdate(), 'dd/MM/yyyy') as CompletionDate 
FROM Table 
where CompletionDate &amp;gt; $(Last_Updated_Date);
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 06:27:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Max-Date/m-p/1653902#M48856</guid>
      <dc:creator>user8</dc:creator>
      <dc:date>2019-12-04T06:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: Max Date</title>
      <link>https://community.qlik.com/t5/App-Development/Max-Date/m-p/1653936#M48858</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I can see a couple of things to check here:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Comment out&amp;nbsp;&lt;EM&gt;"Drop table SRO;".&amp;nbsp;&lt;/EM&gt;Reload, open Data Model Viewer, see field&amp;nbsp;&lt;EM&gt;CompletionDate&lt;/EM&gt; is tagged with &lt;EM&gt;$numeric $timestamp&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;Also after reload, open variable viewer and see which value variable&amp;nbsp;&lt;EM&gt;Last_Updated_Date&lt;/EM&gt; holds. It may happen that this variable stores a numeric value (for example 43470) instead of date format as an effect of &lt;EM&gt;Max()&lt;/EM&gt; function you use to find &lt;EM&gt;Maxdate&lt;/EM&gt;. If this is the case, convert it back to date format:&lt;/LI&gt;&lt;/OL&gt;&lt;LI-CODE lang="cpp"&gt;Let Last_Updated_Date=Date(peek('Maxdate',0,'Last_Updated_Date'));&lt;/LI-CODE&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Vu Nguyen&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 07:54:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Max-Date/m-p/1653936#M48858</guid>
      <dc:creator>vunguyenq89</dc:creator>
      <dc:date>2019-12-04T07:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: Max Date</title>
      <link>https://community.qlik.com/t5/App-Development/Max-Date/m-p/1655793#M49032</link>
      <description>&lt;P&gt;Thanks Vu Nguyen for your help.&lt;BR /&gt;The command "Let Last_Updated_Date=Date(peek('Maxdate',0,'Last_Updated_Date'));" helped to enable CompletionDate to be recognized as a valid Date.&lt;/P&gt;&lt;P&gt;I ran the incremental load and here are the results (refer to my comments in &lt;FONT color="#FF0000"&gt;red&lt;/FONT&gt;) :&lt;/P&gt;&lt;P&gt;Started loading data&lt;BR /&gt;SRO &amp;lt;&amp;lt; SRO&lt;BR /&gt;(QVD (row-based) optimized)&lt;BR /&gt;Lines fetched: 1,181&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;FONT color="#FF0000"&gt;====&amp;gt; There were 1,181 lines in the existing QVD file&lt;/FONT&gt;&lt;BR /&gt;Last_Updated_Date &amp;lt;&amp;lt; SRO&lt;BR /&gt;Lines fetched: 1&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; 12/9/2019&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;FONT color="#FF0000"&gt;====&amp;gt; Maxdate&lt;/FONT&gt;&lt;BR /&gt;Incremental &amp;lt;&amp;lt; vwSROHeader&lt;BR /&gt;Lines fetched: 1,189&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;FONT color="#FF0000"&gt;====&amp;gt; There were 1,189 lines in DB, which means 8 new lines will be added to the QVD file&lt;/FONT&gt;&lt;BR /&gt;Incremental &amp;lt;&amp;lt; SRO&lt;BR /&gt;(QVD (row-based) optimized)&lt;BR /&gt;Lines fetched: 1,189&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;FONT color="#FF0000"&gt;====&amp;gt; My question is here it shows 1,189 lines fetched. Does this mean it fetched all the 1,189 lines again or just the 8 new lines to the QVD File?&lt;/FONT&gt;&lt;BR /&gt;Creating search index&lt;BR /&gt;Search index creation completed successfully&lt;BR /&gt;App saved&lt;BR /&gt;Finished successfully&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2019 07:15:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Max-Date/m-p/1655793#M49032</guid>
      <dc:creator>user8</dc:creator>
      <dc:date>2019-12-10T07:15:31Z</dc:date>
    </item>
  </channel>
</rss>

