<?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:get max date from qvd in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/get-max-date-from-qvd/m-p/215336#M68808</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Polmar,&lt;/P&gt;&lt;P&gt;Nice idea but it didnt work for me (it created Syn1 table) to join the Maxdate table to table1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Oct 2009 00:31:55 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-10-14T00:31:55Z</dc:date>
    <item>
      <title>get max date from qvd</title>
      <link>https://community.qlik.com/t5/QlikView/get-max-date-from-qvd/m-p/215332#M68804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;im been using peek -1 but its returnig the wrong value as im doing a concatenated load and the lastloaded value is not the max value.&lt;/P&gt;&lt;P&gt;[Code] select CreatedDate from table1 order by created date asc //Peek ('createddate', -1) would work here&lt;BR /&gt;Concatenate&lt;BR /&gt;select CreatedDate from table2 order by created date asc //Now same peek would fail as the max from table 2 may not be larger than the max of table 1&lt;/P&gt;&lt;P&gt;//Store to QVD&lt;BR /&gt;//Peek ('Createddate', -1) [\Code]&lt;/P&gt;&lt;P&gt;Can you peek the max created date from a QVD?&lt;/P&gt;&lt;P&gt;Colin R&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Oct 2009 23:33:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/get-max-date-from-qvd/m-p/215332#M68804</guid>
      <dc:creator />
      <dc:date>2009-10-13T23:33:23Z</dc:date>
    </item>
    <item>
      <title>get max date from qvd</title>
      <link>https://community.qlik.com/t5/QlikView/get-max-date-from-qvd/m-p/215333#M68805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Colin,&lt;/P&gt;&lt;P&gt;peek(field, -1) doesn't return the maximum - it returns the value from the last row in the table (or in the field, if you omit the table name). When you load the field from a single table, ordered by date, the two values are identical - the last value of the date is also the maximum. If you load the field from two tables, the result might not be the same, depending on the specific dates in each table...&lt;/P&gt;&lt;P&gt;If you want to be sure, reload your data and calculate the max(Date), and only then peek it into a variable.&lt;/P&gt;&lt;P&gt;Using "order by" in a QVD load must force the load into a not optimized mode, which is really slow - you might even save time by loading the data "as is" and then aggregating in memory...&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Oct 2009 23:46:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/get-max-date-from-qvd/m-p/215333#M68805</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2009-10-13T23:46:30Z</dc:date>
    </item>
    <item>
      <title>get max date from qvd</title>
      <link>https://community.qlik.com/t5/QlikView/get-max-date-from-qvd/m-p/215334#M68806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I do not understand you very much, but maybe with this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;Dates:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt; Date&lt;BR /&gt; 10/10/2009&lt;BR /&gt; 11/10/2009&lt;BR /&gt;];&lt;BR /&gt;&lt;BR /&gt;store Dates into Dates.ild;&lt;BR /&gt;&lt;BR /&gt;MaxDate:&lt;BR /&gt;Load date(max(Date)) as MaxDate&lt;BR /&gt;From Dates.ild (QVD);&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Oct 2009 23:47:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/get-max-date-from-qvd/m-p/215334#M68806</guid>
      <dc:creator />
      <dc:date>2009-10-13T23:47:14Z</dc:date>
    </item>
    <item>
      <title>Re:get max date from qvd</title>
      <link>https://community.qlik.com/t5/QlikView/get-max-date-from-qvd/m-p/215335#M68807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;oleg,polmar&lt;/P&gt;&lt;P&gt;You are both correct, I dont want to use order by on load and i understand that my last row of the concatenated tables may not be the max date! I like the look of polmars solution as Im attempting to get the max loaded date in the qvd for use in the where clause of an incremental load.&lt;/P&gt;&lt;P&gt;The ReloadTime function doesnt seem to be accurate enough for my purposes. I have data streaming into my source table at subsecond rates!&lt;/P&gt;&lt;P&gt;Colin R&lt;BR /&gt;(Im Learning that there is more to learn)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Oct 2009 00:16:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/get-max-date-from-qvd/m-p/215335#M68807</guid>
      <dc:creator />
      <dc:date>2009-10-14T00:16:53Z</dc:date>
    </item>
    <item>
      <title>Re:get max date from qvd</title>
      <link>https://community.qlik.com/t5/QlikView/get-max-date-from-qvd/m-p/215336#M68808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Polmar,&lt;/P&gt;&lt;P&gt;Nice idea but it didnt work for me (it created Syn1 table) to join the Maxdate table to table1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Oct 2009 00:31:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/get-max-date-from-qvd/m-p/215336#M68808</guid>
      <dc:creator />
      <dc:date>2009-10-14T00:31:55Z</dc:date>
    </item>
    <item>
      <title>get max date from qvd</title>
      <link>https://community.qlik.com/t5/QlikView/get-max-date-from-qvd/m-p/215337#M68809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oleg,&lt;/P&gt;&lt;P&gt;Back to you please:&lt;/P&gt;&lt;P&gt;You Quoted "If you want to be sure, reload your data and calculate the max(CreatedDate), and only then peek it into a variable."&lt;BR /&gt;&lt;BR /&gt; Im new to Qv can you explain how to do this in the load script I tried earlier and got a error that i couldnt use max()&lt;/P&gt;&lt;P&gt;To be clear.&lt;/P&gt;&lt;P&gt;Im storing Initial Data Load into a QVD aliasing Field Names&lt;BR /&gt;Then Load * from QVD.&lt;BR /&gt;Then id Like to get max(CreatedDate) from Loaded QVD&lt;BR /&gt;Then Concatenate Load Where CreatedDate &amp;gt; max(CreatedDate)&lt;/P&gt;&lt;P&gt;Cheers&lt;BR /&gt;Colin R&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Oct 2009 00:38:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/get-max-date-from-qvd/m-p/215337#M68809</guid>
      <dc:creator />
      <dc:date>2009-10-14T00:38:29Z</dc:date>
    </item>
    <item>
      <title>get max date from qvd</title>
      <link>https://community.qlik.com/t5/QlikView/get-max-date-from-qvd/m-p/215338#M68810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Colin,&lt;/P&gt;&lt;P&gt;you should use something like the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;Tab1:&lt;BR /&gt;load * from myfile.qvd (qvd);&lt;BR /&gt;&lt;BR /&gt;Tab2:&lt;BR /&gt;load&lt;BR /&gt; max(CreatedDate) as MaxCreatedDate&lt;BR /&gt;resident Tab1&lt;BR /&gt;;&lt;BR /&gt;let v_MaxDate = peek('MaxCreatedDate');&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;Notice that the function max() will return a number (not a date). In order to present the result later on, you'll need to format it using function date(field, 'format')&lt;/P&gt;&lt;P&gt;cheers!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Oct 2009 02:59:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/get-max-date-from-qvd/m-p/215338#M68810</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2009-10-14T02:59:18Z</dc:date>
    </item>
    <item>
      <title>get max date from qvd</title>
      <link>https://community.qlik.com/t5/QlikView/get-max-date-from-qvd/m-p/215339#M68811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Cheers oleg, thanks for your time.&lt;/P&gt;&lt;P&gt;Its going to take a while to get up to speed with this product. Does the resident load have any Perfromance impacts . the Source QVD's are going to Get Huge (5 million rows for October so far) in Weekly QVD's (still need to work out how to load them as a collection)&lt;/P&gt;&lt;P&gt;I have completed the online tutorial and have 3 days of "in house" training booked. What would you suggest as the topics for this training as im supposed to be the "QlikVeiw guy" on its completion. the course content is up to me. Obviously i Want maximum value from this time.&lt;/P&gt;&lt;P&gt;Colin R&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Colin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Oct 2009 16:59:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/get-max-date-from-qvd/m-p/215339#M68811</guid>
      <dc:creator />
      <dc:date>2009-10-14T16:59:05Z</dc:date>
    </item>
    <item>
      <title>get max date from qvd</title>
      <link>https://community.qlik.com/t5/QlikView/get-max-date-from-qvd/m-p/215340#M68812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It created a new table and a syn table(s),I presume because the table structure had changed between the qvd load the maxdate date field and the Next concatenate.&lt;/P&gt;&lt;P&gt;I needed a drop field once id peeked the variable,&lt;/P&gt;&lt;P&gt;the Calc of MaxDate over an initial 5m rows took a while though ..&lt;/P&gt;&lt;P&gt;Colin R&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Oct 2009 18:22:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/get-max-date-from-qvd/m-p/215340#M68812</guid>
      <dc:creator />
      <dc:date>2009-10-14T18:22:12Z</dc:date>
    </item>
    <item>
      <title>get max date from qvd</title>
      <link>https://community.qlik.com/t5/QlikView/get-max-date-from-qvd/m-p/215341#M68813</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Guys&lt;/P&gt;&lt;P&gt;Im already up to 2 million rows in the resident table and this block of code to get max (created date) is taking just short of 30 Seconds to get!&lt;/P&gt;&lt;P&gt;Calculating it before an incremental load and updating it after is taking almost a minute ! can you suggest a faster method ?&lt;/P&gt;&lt;P&gt;perhaps saving the variable Lastupdated into a file ?&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;ColinR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;trace Updating Last loaded Date;&lt;BR /&gt;ADD load max(CreatedDate) as MaxCreatedDate resident stkTRN;&lt;BR /&gt;let LastLoad = Date(peek('MaxCreatedDate'),'YYYYMMDD hh:mm:ss');&lt;BR /&gt;add drop field MaxCreatedDate;&lt;BR /&gt;trace Last Date Loaded $(LastLoad);&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2009 18:11:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/get-max-date-from-qvd/m-p/215341#M68813</guid>
      <dc:creator />
      <dc:date>2009-10-15T18:11:33Z</dc:date>
    </item>
    <item>
      <title>get max date from qvd</title>
      <link>https://community.qlik.com/t5/QlikView/get-max-date-from-qvd/m-p/215342#M68814</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;depending of the structure/setup of the database you might gain speed by doing the max(CreatedDate) directly from SQL. I assume you doing something like this;&lt;/P&gt;&lt;P&gt;Full Load (maybee on a weekly basis or similiar)&lt;/P&gt;&lt;P&gt;&amp;lt;code&amp;gt;&lt;/P&gt;&lt;P&gt;Complete:&lt;/P&gt;&lt;P&gt;Select * from dbo.Table1;&lt;/P&gt;&lt;P&gt;store Complete into data\complete.qvd;&lt;/P&gt;&lt;P&gt;drop table Complete;&lt;/P&gt;&lt;P&gt;MaxDate:&lt;/P&gt;&lt;P&gt;Select max(CreatedDate) as MaxDate from dbo.Table1;&lt;/P&gt;&lt;P&gt;store MaxDate into data\maxDate.qvd;&lt;/P&gt;&lt;P&gt;&amp;lt;/code&amp;gt;&lt;/P&gt;&lt;P&gt;Next day, you do a incremental load... But before that, fetch the maxDate out of the maxDate.qvd.&lt;/P&gt;&lt;P&gt;&amp;lt;code&amp;gt;&lt;/P&gt;&lt;P&gt;MaxDate:&lt;/P&gt;&lt;P&gt;Load MaxDate from data\MaxDate.qvd;&lt;/P&gt;&lt;P&gt;Let vMaxDate = peek(MaxDate,-1);&lt;/P&gt;&lt;P&gt;drop table MaxDate;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inc:&lt;/P&gt;&lt;P&gt;Select * from dbo.Table1 where CreatedDate &amp;gt;'$(vMaxDate)';&lt;/P&gt;&lt;P&gt;store Inc into Data\inc.qvd;&lt;/P&gt;&lt;P&gt;&amp;lt;/code&amp;gt;&lt;/P&gt;&lt;P&gt;Now, concatenate the Complete and Inc qvd.&lt;/P&gt;&lt;P&gt;NB! To be sure to include all the data, you should consider doing a ...where CreatedDate&amp;gt;='$(vMaxDate)' and then use the "where not exists". This will slow down the performance, but if the db is updated 24/7 this might be the only way to go.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2009 19:38:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/get-max-date-from-qvd/m-p/215342#M68814</guid>
      <dc:creator>blaise</dc:creator>
      <dc:date>2009-10-15T19:38:44Z</dc:date>
    </item>
    <item>
      <title>get max date from qvd</title>
      <link>https://community.qlik.com/t5/QlikView/get-max-date-from-qvd/m-p/215343#M68815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunatly the Source table has changed significantly between a Load completing and a seperate step query for maxdate from the DB. Im getting approx 500 rows per second for most of the day and its a 24/7 transactional table&lt;/P&gt;&lt;P&gt;Thanks for the idea of using seperate tables and concatenating using Where not exists, especially if i can do this with resident tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2009 23:49:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/get-max-date-from-qvd/m-p/215343#M68815</guid>
      <dc:creator />
      <dc:date>2009-10-15T23:49:59Z</dc:date>
    </item>
    <item>
      <title>get max date from qvd</title>
      <link>https://community.qlik.com/t5/QlikView/get-max-date-from-qvd/m-p/215344#M68816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an idea, can someone code it for me please. (it came from a modified version of blaises suggestion)&lt;/P&gt;&lt;P&gt;declare initial Startdate and endDate variables //for first load only&lt;BR /&gt;Store Startdate,EndDate to NextLoad.QVD&lt;BR /&gt;Load * from mydata.qvd where CreatedDate between StartDate and EndDate&lt;BR /&gt;//Update NextLoad.qvd&lt;BR /&gt;Store Old EndDate as Startdate,EndDate as now + 5 minutes overwriting NextLoad.QVD&lt;/P&gt;&lt;P&gt;This means that I wont need to Query Existing Data.QVD for the max Date as I will always now in advance what it should be&lt;/P&gt;&lt;P&gt;ColinR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Oct 2009 00:09:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/get-max-date-from-qvd/m-p/215344#M68816</guid>
      <dc:creator />
      <dc:date>2009-10-16T00:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: get max date from qvd</title>
      <link>https://community.qlik.com/t5/QlikView/get-max-date-from-qvd/m-p/215345#M68817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is super fast. Just reload the max of the field from the source QVD again.&lt;/P&gt;&lt;P&gt;A++&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the above example......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MaxDate:&lt;/P&gt;&lt;P&gt;Load date(max(Date)) as MaxDate&lt;/P&gt;&lt;P&gt;From Dates.ild (QVD);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Oct 2015 13:08:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/get-max-date-from-qvd/m-p/215345#M68817</guid>
      <dc:creator>pgriffiths</dc:creator>
      <dc:date>2015-10-02T13:08:19Z</dc:date>
    </item>
  </channel>
</rss>

