<?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: Variable to get the max(date) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301204#M1194170</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I didn't try with the solution that you have provided as I need to understand everything before implementing in mine. I am trying something like below. If I am loading it for the first time as there won't be any Login.qvd created. Could which is inside the block(/////) will be executed. For next time onwards whatever the code which is there after "end if" will be executed(Which will concatenate the data into the login.qvd from the text file and as well from the session log).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One which I still wanted to do it here is I want to check the max(LoginDate) which is loaded from the text file and max(LoginDate) which is loaded from the sessions qvd. Both is there now in a single qvd(Login.qvd). Using this two max(LoginDate) I want to concatenate the data in to the Login.qvd which is there in the 2nd block.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please guide me on how to to get the max(LoginDate) from Text file and Session log which can be used in the 2nd block. I think to get the Max(LoginDate) we need to write where condition to pull the Max(LoginDate) from the one which is loaded in the text file and Sessions Log.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;/**************************************** 1st Block*************************************/&lt;BR /&gt;//////////////////////&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;if isnull(filetime('C:\Login.qvd')) then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Login:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD @1 as LoginDate, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @2 as User, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @3 as Product&lt;BR /&gt;FROM&lt;BR /&gt;&lt;C&gt;&lt;BR /&gt;(txt, codepage is 1252, no labels, delimiter is ',', msq);&lt;/C&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Concatenate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Product, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LoginDate,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; User&lt;BR /&gt;FROM&lt;BR /&gt;$(Path)\SESSIONS*.LOG (utf8, txt, delimiter is '\t', embedded labels);&lt;/P&gt;&lt;P&gt;Store Login into Login.qvd (qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop table Logon;&lt;/P&gt;&lt;P&gt;&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;/**************************************** 2nd Block*************************************/&lt;BR /&gt;Logon:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD LoginDate, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; User, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Product&lt;BR /&gt;FROM&lt;BR /&gt;&lt;C&gt;&lt;BR /&gt;(qvd);&lt;/C&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD @1 as LoginDate, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @2 as User, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @3 as Product&lt;BR /&gt;FROM&lt;BR /&gt;&lt;C&gt;&lt;BR /&gt;(txt, codepage is 1252, no labels, delimiter is ',', msq)&lt;BR /&gt;;&lt;/C&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Product, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LoginDate,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; User&lt;BR /&gt;FROM&lt;BR /&gt;$(Path)\SESSIONS*.LOG (utf8, txt, delimiter is '\t', embedded labels);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Store Logon into Logon.qvd (qvd); &lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 18 Jun 2011 11:59:42 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-06-18T11:59:42Z</dc:date>
    <item>
      <title>Variable to get the max(date)</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301200#M1194166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After loading the data in the Login table to how can I get the Max(LoginDate) and store it in a variable which has to be used while appending the only the new data into the QVD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;Login:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD @1 as LoginDate, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @2 as User, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @3 as Product&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;C&gt;&lt;/C&gt;&lt;/P&gt;&lt;P&gt;(txt, codepage is 1252, no labels, delimiter is ',', msq);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Help required to create the variable. Which will be used in the below script to append only those data which &lt;/P&gt;&lt;P&gt;//is not there in the above table records&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Store * from Login into Login.qvd;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;CONCATENATE&lt;BR /&gt; &lt;BR /&gt;&lt;P&gt;LOAD @1 as LoginDate, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @2 as User, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @3 as Product&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;C&gt;&lt;/C&gt;&lt;/P&gt;&lt;P&gt;(txt, codepage is 1252, no labels, delimiter is ',', msq)&lt;/P&gt;&lt;P&gt;WHERE LoginDate &amp;gt; Max(LoginDate) which will come from the variable. &lt;STRONG&gt;I need help for this please.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Store * from Login into Login.qvd;&lt;/P&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attitude&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Jun 2011 07:17:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301200#M1194166</guid>
      <dc:creator />
      <dc:date>2011-06-18T07:17:10Z</dc:date>
    </item>
    <item>
      <title>Variable to get the max(date)</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301201#M1194167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM&gt;Attitude,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If i understood your question Properly.I`m sure we dont need to store the value in variable to take the max of valuee from you login table. Your code should look like below.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Login:&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;LOAD @1 as LoginDate, &lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @2 as User, &lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @3 as Product&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;FROM&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;C&gt;&lt;/C&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;(txt, codepage is 1252, no labels, delimiter is ',', msq);&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt; //Help required to create the variable. Which will be used in the below script to append only those data which &lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;//is not there in the above table records&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Store * from Login into Login.qvd;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;/////////////////////////EDITED PATRT OF THE SCRIPT////////////////////////////////&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;NEW_LOGIN_TABLE:&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;NOCONCATENATE&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;LOAD DATE(MAX(LoginDate)) AS LoginDate &lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;RESIDENT Login;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;INNERT JOIN&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;LOAD @1 as LoginDate, &lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @2 as User, &lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @3 as Product&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;FROM&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;C&gt;&lt;/C&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;(txt, codepage is 1252, no labels, delimiter is ',', msq);&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;CONCATENATE (Login)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;LOAD * RESIDENT NEW_LOGIN_TABLE;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;DROP TBALE NEW_LOGIN_TABLE;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;/////////////////////////////////////////////////////////////////////////////////////&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt; Store * from Login into Login.qvd;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Sridhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Jun 2011 08:09:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301201#M1194167</guid>
      <dc:creator />
      <dc:date>2011-06-18T08:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: Variable to get the max(date)</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301202#M1194168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sridhar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help! I didn't try the solution that has been given by you as I didn't understood.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have done something like below. Only problem in the below code is I am not checking max(LoginDate) or ReloadTime() while concatanting the 2nd text file. I am concatanating all the data from the 2nd text file into the qvd instead of loading only those data which is not there in the existing qvd.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;Login:&lt;/P&gt;&lt;P&gt;LOAD @1 as LoginDate, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @2 as User, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @3 as Product&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //ReloadTime() as LastReload&lt;BR /&gt;FROM&lt;BR /&gt;&lt;C&gt;&lt;BR /&gt;(txt, codepage is 1252, no labels, delimiter is ',', msq);&lt;/C&gt;&lt;/P&gt;&lt;P&gt;Store Logon into Login.qvd (qvd);&lt;/P&gt;&lt;P&gt;Drop table Login;&lt;/P&gt;&lt;P&gt;Login:&lt;/P&gt;&lt;P&gt;LOAD LoginDate, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; User &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Product&lt;BR /&gt;FROM&lt;BR /&gt;&lt;C&gt;&lt;BR /&gt;(qvd);&lt;/C&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE&lt;/P&gt;&lt;P&gt;LOAD @1 as LoginDate, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @2 as User, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @3 as Product&lt;BR /&gt;FROM&lt;BR /&gt;&lt;C&gt;&lt;BR /&gt;(txt, codepage is 1252, no labels, delimiter is ',', msq)&lt;BR /&gt;;&lt;/C&gt;&lt;/P&gt;&lt;P&gt;Store Login into Login.qvd (qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it is understandable about my requirement. If no please let me know!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attitude&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Jun 2011 08:49:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301202#M1194168</guid>
      <dc:creator />
      <dc:date>2011-06-18T08:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: Variable to get the max(date)</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301203#M1194169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sridhar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think what I did may not be the right way of doing it. Instead I got one more idea. I think we use the below script which is between the block(/////) in a seperate application so that this script does not executed again and again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is one more way of doing it. I think I need to search for some kind of function which check whether qvd is available or not. If the qvd is already available script between the block(//////) should not get executed. What do you say?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;//////////////////////////////////////////////////////////////////&lt;/P&gt;&lt;P&gt;Login:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD @1 as LoginDate, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @2 as User, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @3 as Product&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //ReloadTime() as LastReload&lt;BR /&gt;FROM&lt;BR /&gt;&lt;C&gt;&lt;BR /&gt;(txt, codepage is 1252, no labels, delimiter is ',', msq);&lt;/C&gt;&lt;/P&gt;&lt;P&gt;Store Logon into Login.qvd (qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop table Login;&lt;/P&gt;&lt;P&gt;///////////////////////////////////////////////////////////////////&lt;/P&gt;&lt;P&gt;Login:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD LoginDate, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; User &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Product&lt;BR /&gt;FROM&lt;BR /&gt;&lt;C&gt;&lt;BR /&gt;(qvd);&lt;/C&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD @1 as LoginDate, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @2 as User, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @3 as Product&lt;BR /&gt;FROM&lt;BR /&gt;&lt;C&gt;&lt;BR /&gt;(txt, codepage is 1252, no labels, delimiter is ',', msq)&lt;BR /&gt;;&lt;/C&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Store Login into Login.qvd (qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Jun 2011 09:23:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301203#M1194169</guid>
      <dc:creator />
      <dc:date>2011-06-18T09:23:02Z</dc:date>
    </item>
    <item>
      <title>Re: Variable to get the max(date)</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301204#M1194170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I didn't try with the solution that you have provided as I need to understand everything before implementing in mine. I am trying something like below. If I am loading it for the first time as there won't be any Login.qvd created. Could which is inside the block(/////) will be executed. For next time onwards whatever the code which is there after "end if" will be executed(Which will concatenate the data into the login.qvd from the text file and as well from the session log).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One which I still wanted to do it here is I want to check the max(LoginDate) which is loaded from the text file and max(LoginDate) which is loaded from the sessions qvd. Both is there now in a single qvd(Login.qvd). Using this two max(LoginDate) I want to concatenate the data in to the Login.qvd which is there in the 2nd block.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please guide me on how to to get the max(LoginDate) from Text file and Session log which can be used in the 2nd block. I think to get the Max(LoginDate) we need to write where condition to pull the Max(LoginDate) from the one which is loaded in the text file and Sessions Log.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;/**************************************** 1st Block*************************************/&lt;BR /&gt;//////////////////////&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;if isnull(filetime('C:\Login.qvd')) then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Login:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD @1 as LoginDate, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @2 as User, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @3 as Product&lt;BR /&gt;FROM&lt;BR /&gt;&lt;C&gt;&lt;BR /&gt;(txt, codepage is 1252, no labels, delimiter is ',', msq);&lt;/C&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Concatenate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Product, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LoginDate,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; User&lt;BR /&gt;FROM&lt;BR /&gt;$(Path)\SESSIONS*.LOG (utf8, txt, delimiter is '\t', embedded labels);&lt;/P&gt;&lt;P&gt;Store Login into Login.qvd (qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop table Logon;&lt;/P&gt;&lt;P&gt;&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;/**************************************** 2nd Block*************************************/&lt;BR /&gt;Logon:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD LoginDate, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; User, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Product&lt;BR /&gt;FROM&lt;BR /&gt;&lt;C&gt;&lt;BR /&gt;(qvd);&lt;/C&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD @1 as LoginDate, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @2 as User, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @3 as Product&lt;BR /&gt;FROM&lt;BR /&gt;&lt;C&gt;&lt;BR /&gt;(txt, codepage is 1252, no labels, delimiter is ',', msq)&lt;BR /&gt;;&lt;/C&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Product, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LoginDate,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; User&lt;BR /&gt;FROM&lt;BR /&gt;$(Path)\SESSIONS*.LOG (utf8, txt, delimiter is '\t', embedded labels);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Store Logon into Logon.qvd (qvd); &lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Jun 2011 11:59:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301204#M1194170</guid>
      <dc:creator />
      <dc:date>2011-06-18T11:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: Variable to get the max(date)</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301205#M1194171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Deepak suggested you to him me on this. Please try to help me out when you find free time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to load only those data which is not available in the WHERE condition of the 2nd block. I tried to store the max(logindate) of both text file and session log in a varialble but it didn't work. Also tried to load the max(LoginDate) from both the text file and sessions log in a seperate table of a field but it didn't work either.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can some please do the required change in the 2nd block of my code so that it store only those rows which is not available in the existing qvd(&lt;STRONG&gt;I need your help where the text is in BOLD letters in 2nd block&lt;/STRONG&gt;). This is urgent requirement! Hope you can understand!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;/**************************************** 1st Block*************************************/&lt;BR /&gt;//////////////////////&lt;BR /&gt;if isnull(filetime('C:\Login.qvd')) then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Login:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD @1 as LoginDate, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @2 as User, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @3 as Product&lt;BR /&gt;FROM&lt;BR /&gt;&lt;C&gt;&lt;BR /&gt;(txt, codepage is 1252, no labels, delimiter is ',', msq);&lt;/C&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Concatenate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Product, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LoginDate,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; User&lt;BR /&gt;FROM&lt;BR /&gt;$(Path)\SESSIONS*.LOG (utf8, txt, delimiter is '\t', embedded labels);&lt;/P&gt;&lt;P&gt;Store Login into Login.qvd (qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop table Logon;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end if;&lt;BR /&gt;////////////////////////&lt;/P&gt;&lt;P&gt;/**************************************** 2nd Block*************************************/&lt;BR /&gt;Logon:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD LoginDate, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; User, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Product&lt;BR /&gt;FROM&lt;BR /&gt;&lt;C&gt;&lt;BR /&gt;(qvd);&lt;/C&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD @1 as LoginDate, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @2 as User, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @3 as Product&lt;BR /&gt;FROM&lt;BR /&gt;&lt;C&gt;&lt;BR /&gt;(txt, codepage is 1252, no labels, delimiter is ',', msq)&lt;BR /&gt;&lt;STRONG&gt;WHERE Date(@1) &amp;gt; Max(LoginDate) of text file;&lt;/STRONG&gt;&lt;/C&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;CONCATENATE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Product, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LoginDate,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; User&lt;BR /&gt;FROM&lt;BR /&gt;$(Path)\SESSIONS*.LOG (utf8, txt, delimiter is '\t', embedded labels)&lt;BR /&gt;&lt;STRONG&gt;WHERE Date(@1) &amp;gt; Max(LoginDate) of session log;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Store Logon into Logon.qvd (qvd); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attitude&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 05:08:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301205#M1194171</guid>
      <dc:creator />
      <dc:date>2011-06-20T05:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: Variable to get the max(date)</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301206#M1194172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM style="color: #333333; font-size: 10pt; font-family: 'Arial','sans-serif';"&gt;Hi,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #333333; font-size: 10pt; font-family: 'Arial','sans-serif';"&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #333333; font-size: 10pt; font-family: 'Arial','sans-serif';"&gt;I have modified your 2nd block below. what i have understood form your earlier post is , You want to load the max of logindate from Logon tabel and load the respective data from the session and status table. if that is your problem then below is the code for your problem.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #333333; font-size: 10pt; font-family: 'Arial','sans-serif';"&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #333333; font-size: 10pt; font-family: 'Arial','sans-serif';"&gt;What I’m doing here is creating the temp table to store max value of the logon date and and storing the same to a variable and using that variable in session &amp;amp;status Table to restrict data.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #333333; font-size: 10pt; font-family: 'Arial','sans-serif';"&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #333333; font-size: 10pt; font-family: 'Arial','sans-serif';"&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Logon:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD LoginDate, &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; User, &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Product&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;C&gt;&lt;/C&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;(qvd);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Logon_Temp:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Load Max(LoginDate) as LoginDate_Max&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;//Taking the max of date from Login table&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Resident Logon;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Let vStoreMaxLogin = Peek(LoginDate_Max,-1, Logon_Temp);&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;//storing the max date in variable&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Drop table Logon_Temp; &lt;STRONG&gt;//Droping the Temp table, Since we are not going to use this in any of&amp;nbsp; our below &lt;/STRONG&gt;&lt;/EM&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;CONCATENATE (Logon)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD @1 as LoginDate, &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @2 as User, &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @3 as Product&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;C&gt;&lt;/C&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;(txt, codepage is 1252, no labels, delimiter is ',', msq)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;WHERE Date(@1) &amp;gt; Max(Date#(vStoreMaxLogin,’DD/MM/YYYY’)) of text file;&amp;nbsp; &lt;STRONG&gt;// here vStoreMaxLogin is the&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;//variable which stores the max of login date. Make //sure your date format is correct.&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;CONCATENATE (Logon)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD Product, &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LoginDate,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; User&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;$(Path)\SESSIONS*.LOG (utf8, txt, delimiter is '\t', embedded labels)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;WHERE Date(@1) &amp;gt; Max(Date#(vStoreMaxLogin,’DD/MM/YYYY’)) of session log; &lt;STRONG&gt;// here vStoreMaxLogin is the&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;//variable which stores the max of login date. //Make sure your date format is correct.&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp; &lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Store Logon into Logon.qvd (qvd);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;I`m attaching a sample application in which i have shown, how to take the max of value to a variable using peek() function.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Have a look at the attached application also.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Hope this may help you.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;- Sridhar&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit : Attached a application to demonstarte the max value to store in variable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 05:34:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301206#M1194172</guid>
      <dc:creator />
      <dc:date>2011-06-20T05:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: Variable to get the max(date)</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301207#M1194173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sridhar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks alot for your help. I am not sure why peek function is required to find the max(LoginDate). Anyway that is not my question now. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now my question is when I ran the script after doing the required change as per your suggestion it says that "vStoreMaxLogin" field is not found when the debugger comes to this location. Please suggest something here for me! Let me know what changes are required here. I did exactly the same changes that you have suggested here. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;&lt;EM&gt;CONCATENATE (Logon)&lt;/EM&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; height: 8pt;"&gt;&lt;EM&gt; &lt;/EM&gt; &lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD @1 as LoginDate, &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @2 as User, &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @3 as Product&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;C&gt;&lt;/C&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;(txt, codepage is 1252, no labels, delimiter is ',', msq)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;WHERE Date(@1) &amp;gt; Max(Date#(vStoreMaxLogin,’DD/MM/YYYY’)) of text file; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attitude&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 06:26:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301207#M1194173</guid>
      <dc:creator />
      <dc:date>2011-06-20T06:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: Variable to get the max(date)</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301208#M1194174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sridhar &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the problem could be somewhere here(Highligted in bold). Yesterday I tried to pass the variable in it like the way you have passed but didn't work. Thats where the confusion is. Please help me out when you find free time as you must be very busy with your work.&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;&lt;CODE class="jive-code"&gt;CONCATENATE (Logon)&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;LOAD @1 as LoginDate, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @2 as User, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @3 as Product&lt;BR /&gt;FROM&lt;BR /&gt;&lt;C&gt;&lt;BR /&gt;(txt, codepage is 1252, no labels, delimiter is ',', msq)&lt;BR /&gt;WHERE Date(@1) &amp;gt; &lt;STRONG&gt;Max(Date#(vStoreMaxLogin,’DD/MM/YYYY’))&lt;/STRONG&gt; of text file; &lt;BR /&gt;&lt;BR /&gt;&lt;/C&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 06:39:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301208#M1194174</guid>
      <dc:creator />
      <dc:date>2011-06-20T06:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: Variable to get the max(date)</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301209#M1194175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to expand the variable in the WHERE clause&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;&lt;CODE class="jive-code"&gt;WHERE Date(@1) &amp;gt; Max(Date#(&lt;STRONG&gt;$(vStoreMaxLogin)&lt;/STRONG&gt;,’DD/MM/YYYY’));&lt;/CODE&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 06:50:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301209#M1194175</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-06-20T06:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: Variable to get the max(date)</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301210#M1194176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Miguel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also thought of samething and did the required changes in it same like what you have suggested for but it didn't work. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got the follow error when I tried with the solution that you have provided.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;Error in expression:&lt;/P&gt;&lt;P&gt;')' expected&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would appreciate if you give any other suggestion. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attitude&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 07:01:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301210#M1194176</guid>
      <dc:creator />
      <dc:date>2011-06-20T07:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: Variable to get the max(date)</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301211#M1194177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just follow the error and close the missing bracket (if there is one)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;&lt;CODE class="jive-code"&gt;WHERE Date(@1) &amp;gt; Max(Date(Date#($(vStoreMaxLogin), 'DD/MM/YYYY')));&lt;/CODE&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By the way, note that we cannot check every line of the code we post, and sometimes we give ideas based on your code, and that code may have syntax errors or mispellings. It's always a good idea to not just copy and paste the code you get here, rather than check it first, understand what it does and how can it help you and then apply it to your data model and script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 07:11:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301211#M1194177</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-06-20T07:11:14Z</dc:date>
    </item>
    <item>
      <title>Re: Variable to get the max(date)</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301212#M1194178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Miguel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am sorry If I am disturbing you. I too agree with you that whatever we do we need to understand and do. I always do that! Only sometimes when I get stuck I get confused.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I followed the error but there is no bracket which needs to be closed. Thats the reason I asked you are you able to find where I have done the mistake?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attitude&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 07:24:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301212#M1194178</guid>
      <dc:creator />
      <dc:date>2011-06-20T07:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: Variable to get the max(date)</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301213#M1194179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There's no problem, it's just you should be able to debug the load and see where the variables or the code is not correct. If it says it's expecting a bracket, it may be because the "Max()" is not getting the value from the variable properly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you try using that Max() piece of code in a textbox to see whether it returns the expected result?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; text-decoration: underline; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 07:31:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301213#M1194179</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-06-20T07:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: Variable to get the max(date)</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301214#M1194180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM&gt;Hi,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Miguel is correct, I forget to include the dollar sign expansion on my code. &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Look at the attached application with dollar sign expansion.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;-Sridhar&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 08:58:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301214#M1194180</guid>
      <dc:creator />
      <dc:date>2011-06-20T08:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: Variable to get the max(date)</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301215#M1194181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sridhar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes! I know that Miguel is correct :-). I have already added the $ symbol and tried but it is not working. Please look at discussion with Miguel for more details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attitude&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 09:11:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301215#M1194181</guid>
      <dc:creator />
      <dc:date>2011-06-20T09:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: Variable to get the max(date)</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301216#M1194182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM&gt;Yes, i read all your discussion with Miguel`s. I though, you are not sure where / how to added the new piece of code to your application, That's why I have attached my example by re-define the code on my last post.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;is it throwing the error after you have added that new code to your application. could you please post your entire scripts here.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;- Sridhar&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 09:32:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301216#M1194182</guid>
      <dc:creator />
      <dc:date>2011-06-20T09:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: Variable to get the max(date)</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301217#M1194183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sridhar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes it is giving below error. If you don't mind can you please wait for hours I will try to send you the entire script. Before that any guesses what could be the reason for the below error.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;CODE class="jive-code"&gt;Error in expression:&lt;BR /&gt;')' expected&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 10:19:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301217#M1194183</guid>
      <dc:creator />
      <dc:date>2011-06-20T10:19:30Z</dc:date>
    </item>
    <item>
      <title>Re: Variable to get the max(date)</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301218#M1194184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sridhar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is exactly the script which I am using it in my application. Requesting you to review it and let me know what is the change that is required here. It is little urgent. Hope you can understand! I will be waiting for your reply...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;/**************************************** 1st Block*************************************/&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;//////////////////////&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;if isnull(filetime('C:\Login.qvd')) then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Login:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD @1 as LoginDate, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @2 as User, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @3 as Product&lt;BR /&gt;FROM&lt;BR /&gt;&lt;C&gt;&lt;BR /&gt;(txt, codepage is 1252, no labels, delimiter is ',', msq);&lt;/C&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Concatenate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Product, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LoginDate,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; User&lt;BR /&gt;FROM&lt;BR /&gt;$(Path)\SESSIONS*.LOG (utf8, txt, delimiter is '\t', embedded labels);&lt;BR /&gt;Store Login into Login.qvd (qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop table Logon;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end if;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;////////////////////////&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/**************************************** 2nd Block*************************************/&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Logon:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD LoginDate, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; User, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Product&lt;BR /&gt;FROM&lt;BR /&gt;&lt;C&gt;&lt;BR /&gt;(qvd);&lt;/C&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Logon_Temp:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load Max(LoginDate) as LoginDate_Max Resident Logon:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vStoreMaxLogin = Peek(LoginDate_Max,-1, Logon_Temp);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Drop table Logon_Temp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;CONCATENATE(Logon)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD @1 as LoginDate, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @2 as User, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @3 as Product&lt;BR /&gt;FROM&lt;BR /&gt;&lt;C&gt;&lt;BR /&gt;(txt, codepage is 1252, no labels, delimiter is ',', msq)&lt;BR /&gt;WHERE Date(@1) &amp;gt; Max(Date#($(vStoreMaxLogin),’DD/MM/YYYY’));&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;//CONCATENATE&lt;/C&gt;&lt;/P&gt;&lt;P&gt;//LOAD Product, &lt;BR /&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LoginDate,&lt;BR /&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; User&lt;BR /&gt;//FROM&lt;BR /&gt;//$(Path)\SESSIONS*.LOG (utf8, txt, delimiter is '\t', embedded labels)&lt;BR /&gt;//WHERE Date(@1) &amp;gt; Max(LoginDate) of session log;&lt;/P&gt;&lt;P&gt;//Store Logon into Logon.qvd (qvd); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 11:30:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301218#M1194184</guid>
      <dc:creator />
      <dc:date>2011-06-20T11:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: Variable to get the max(date)</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301219#M1194185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what I see at a first glance (usually typos when copying / pasting)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;&lt;CODE class="jive-code"&gt;/**************************************** 1st Block*************************************/&lt;BR /&gt;&lt;BR /&gt;//////////////////////&lt;BR /&gt;&lt;BR /&gt;if isnull(filetime('C:\Login.qvd')) then&lt;BR /&gt;&lt;BR /&gt;Login:&lt;BR /&gt;&lt;BR /&gt;LOAD @1 as LoginDate, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @2 as User, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @3 as Product&lt;BR /&gt;FROM&lt;BR /&gt;&lt;C&gt;&lt;BR /&gt;(txt, codepage is 1252, no labels, delimiter is ',', msq);&lt;BR /&gt;&lt;BR /&gt;Concatenate&lt;BR /&gt;&lt;BR /&gt;LOAD Product, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LoginDate,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; User&lt;BR /&gt;FROM&lt;BR /&gt;$(Path)\SESSIONS*.LOG (utf8, txt, delimiter is '\t', embedded labels);&lt;BR /&gt;Store Login into Login.qvd (qvd);&lt;BR /&gt;&lt;BR /&gt;Drop table Logon;&lt;BR /&gt;&lt;BR /&gt;end if;&lt;BR /&gt;&lt;BR /&gt;////////////////////////&lt;BR /&gt;&lt;BR /&gt;/**************************************** 2nd Block*************************************/&lt;BR /&gt;&lt;BR /&gt;Logon:&lt;BR /&gt;&lt;BR /&gt;LOAD LoginDate, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; User, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Product&lt;BR /&gt;FROM&lt;BR /&gt;&lt;C&gt;&lt;BR /&gt;(qvd);&lt;BR /&gt;&lt;BR /&gt;Logon_Temp:&lt;BR /&gt;&lt;BR /&gt;Load Max(LoginDate) as LoginDate_Max Resident Logon&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;; &lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;// semicolon instead of colon&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;Let vStoreMaxLogin = Peek(&lt;STRONG style="color: #ff0000;"&gt;'LoginDate_Max'&lt;/STRONG&gt;, -1, &lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;'Logon_Temp'&lt;/STRONG&gt;&lt;/SPAN&gt;); // Field name and table must be quoted&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;Drop table Logon_Temp;&lt;BR /&gt;&lt;BR /&gt;CONCATENATE(Logon)&lt;BR /&gt;&lt;BR /&gt;LOAD @1 as LoginDate, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @2 as User, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @3 as Product&lt;BR /&gt;FROM&lt;BR /&gt;&lt;C&gt;&lt;BR /&gt;(txt, codepage is 1252, no labels, delimiter is ',', msq)&lt;BR /&gt;WHERE Date(@1) &amp;gt; Max(Date#($(vStoreMaxLogin),&lt;STRONG style="color: #ff0000;"&gt;'DD/MM/YYYY'&lt;/STRONG&gt;&lt;/C&gt;&lt;/C&gt;&lt;/C&gt;&lt;/CODE&gt;&lt;CODE class="jive-code"&gt;)); // Use regular single quotes instead&lt;BR /&gt;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Max() will return a numeric value, Date() will return &lt;BR /&gt;//CONCATENATE&lt;BR /&gt;//LOAD Product, &lt;BR /&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LoginDate,&lt;BR /&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; User&lt;BR /&gt;//FROM&lt;BR /&gt;//$(Path)\SESSIONS*.LOG (utf8, txt, delimiter is '\t', embedded labels)&lt;BR /&gt;//WHERE Date(@1) &amp;gt; Max(LoginDate) of session log;&lt;BR /&gt;//Store Logon into Logon.qvd (qvd); &lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 11:55:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-to-get-the-max-date/m-p/301219#M1194185</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-06-20T11:55:24Z</dc:date>
    </item>
  </channel>
</rss>

