<?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 Peek Function / Append Load in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Peek-Function-Append-Load/m-p/169192#M40082</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I am creating a Append Load for my data using QVDs to speed up the reload time of my document.&lt;/P&gt;&lt;P&gt;I have successfully created the scrip which creates a QVD of the data and then concatenates any "new" data from the database onto the bottom of the QVD.&lt;/P&gt;&lt;P&gt;The problem I am having is with the Peek ( ) function. I am trying to select the last record in the QVD and store the ID into a variable which i will then use later to restrict the re-load from the database. (load everything after this ID)&lt;/P&gt;&lt;P&gt;Although where I am setting the variable, called "successful", equal to Peek(InboundCallTblID, &lt;STRONG&gt;-1&lt;/STRONG&gt; ,Inbound) using "-1" to select the last record of the QVD, the last record ID is not selected? I beleive it is selecting the first record ID in fact as if I remove the minus sign it returns the same ID?&lt;/P&gt;&lt;P&gt;Here is the code I have created:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;/*&lt;/B&gt; InboundCallTracking */&lt;/P&gt;&lt;P&gt;&lt;B&gt;SET&lt;/B&gt; QVDFILE = E:\QlikView\QlikView Data\QlikView Reports\MCC\QVDs\INBOUND.qvd;&lt;/P&gt;&lt;P&gt;&lt;B&gt;IF&lt;/B&gt; FileSize( &lt;B&gt;&lt;I&gt;'$(QVDFILE)'&lt;/I&gt;&lt;/B&gt; ) &amp;gt; 0 &lt;B&gt;THEN&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;SET&lt;/B&gt; QVD_Exists = 1;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;ELSE&lt;/P&gt;&lt;P&gt;&lt;B&gt;SET&lt;/B&gt; QVD_Exists = 0;&lt;/P&gt;&lt;P&gt;&lt;B&gt;END&lt;/B&gt; &lt;B&gt;IF&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;IF&lt;/B&gt; &lt;B&gt;&lt;I&gt;$(QVD_Exists)&lt;/I&gt;&lt;/B&gt; &lt;B&gt;THEN&lt;/B&gt;&lt;/P&gt;&lt;P style="font-style: italic"&gt;InboundQVD:&lt;/P&gt;&lt;P&gt;&lt;B&gt;LOAD&lt;/B&gt; * &lt;B&gt;FROM&lt;/B&gt; &lt;B&gt;&lt;I&gt;$(QVDFILE)&lt;/I&gt;&lt;/B&gt; (qvd);&lt;/P&gt;&lt;P&gt;&lt;B&gt;LET&lt;/B&gt; Successful = PEEK('InboundCallTrackingTblID',-1,'InboundQVD');&lt;/P&gt;&lt;P style="font-weight: bold"&gt;ELSE&lt;/P&gt;&lt;P&gt;&lt;B&gt;LET&lt;/B&gt; Successful = 0;&lt;/P&gt;&lt;P&gt;&lt;B&gt;END&lt;/B&gt; &lt;B&gt;IF&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;DROP&lt;/B&gt; &lt;B&gt;table&lt;/B&gt; &lt;I&gt;InboundQVD;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;IF&lt;/B&gt; &lt;B&gt;&lt;I&gt;$(Successful)&lt;/I&gt;&lt;/B&gt; &amp;gt; 0 &lt;B&gt;THEN&lt;/B&gt;&lt;/P&gt;&lt;P style="font-style: italic"&gt;Inbound:&lt;/P&gt;&lt;P&gt;&lt;B&gt;LOAD&lt;/B&gt;&lt;/P&gt;&lt;P&gt;ID &lt;B&gt;AS&lt;/B&gt; InboundCallTrackingTblID,&lt;/P&gt;&lt;P&gt;CallID,&lt;/P&gt;&lt;P&gt;CalledNumber,&lt;/P&gt;&lt;P&gt;CallerNumber,&lt;/P&gt;&lt;P&gt;AgentID,&lt;/P&gt;&lt;P&gt;Action,&lt;/P&gt;&lt;P style="font-weight: bold"&gt;//Wait Time Variables&lt;/P&gt;&lt;P&gt;If(Action = 'Connected' &lt;B&gt;OR&lt;/B&gt; Action = 'Voicemail' &lt;B&gt;OR&lt;/B&gt; Action = 'TransferInternal' &lt;B&gt;OR&lt;/B&gt; Action = 'TransferExternal',1,0) &lt;B&gt;AS&lt;/B&gt; Answered,&lt;/P&gt;&lt;P&gt;If(Action = 'Connected' &lt;B&gt;OR&lt;/B&gt; Action = 'TransferExternal',1,0) &lt;B&gt;AS&lt;/B&gt; AnsweredNoVoicemail,&lt;/P&gt;&lt;P&gt;If(Action &amp;lt;&amp;gt; 'Connected' &lt;B&gt;AND&lt;/B&gt; Action &amp;lt;&amp;gt; 'TransferExternal' &lt;B&gt;AND&lt;/B&gt; Action &amp;lt;&amp;gt; 'Voicemail' &lt;B&gt;AND&lt;/B&gt; Action &amp;lt;&amp;gt; 'TransferInternal',1,0) &lt;B&gt;AS&lt;/B&gt; Missed,&lt;/P&gt;&lt;P style="font-weight: bold"&gt;//Internal Overflow Variables&lt;/P&gt;&lt;P&gt;If(Action = 'TransferInternal' &lt;B&gt;OR&lt;/B&gt; Action = 'TimeOut',1,0) &lt;B&gt;AS&lt;/B&gt; InternalOverFlowTimeOut,&lt;/P&gt;&lt;P&gt;If(Action = 'TransferInternal' &lt;B&gt;OR&lt;/B&gt; Action = 'ToLongWaiting',1,0) &lt;B&gt;AS&lt;/B&gt; InternalOverFlowToLongWaiting,&lt;/P&gt;&lt;P&gt;If(Action = 'TransferInternal' &lt;B&gt;OR&lt;/B&gt; Action = 'ToManyWaiting',1,0) &lt;B&gt;AS&lt;/B&gt; InternalOverFlowToManyWaiting,&lt;/P&gt;&lt;P&gt;If(Action = 'TransferInternal' &lt;B&gt;OR&lt;/B&gt; Action = 'CalendarClosed',1,0) &lt;B&gt;AS&lt;/B&gt; InternalOverFlowCalendar,&lt;/P&gt;&lt;P&gt;If(Action = 'TransferInternal' &lt;B&gt;OR&lt;/B&gt; Action = 'HolidayClosed',1,0) &lt;B&gt;AS&lt;/B&gt; InternalOverFlowHoliday,&lt;/P&gt;&lt;P&gt;If(Action = 'TransferInternal' &lt;B&gt;OR&lt;/B&gt; Action = 'ManualClosed',1,0) &lt;B&gt;AS&lt;/B&gt; InternalOverFlowManual,&lt;/P&gt;&lt;P&gt;If(Action = 'TransferInternal' &lt;B&gt;OR&lt;/B&gt; Action = 'NoAgent',1,0) &lt;B&gt;AS&lt;/B&gt; InternalOverFlowNoAgent,&lt;/P&gt;&lt;P style="font-weight: bold"&gt;//External Overflow Variables&lt;/P&gt;&lt;P&gt;If(Action = 'TransferExternal' &lt;B&gt;OR&lt;/B&gt; Action = 'TimeOut',1,0) &lt;B&gt;AS&lt;/B&gt; ExternalOverFlowTimeOut,&lt;/P&gt;&lt;P&gt;If(Action = 'TransferExternal' &lt;B&gt;OR&lt;/B&gt; Action = 'ToLongWaiting',1,0) &lt;B&gt;AS&lt;/B&gt; ExternalOverFlowToLongWaiting,&lt;/P&gt;&lt;P&gt;If(Action = 'TransferExternal' &lt;B&gt;OR&lt;/B&gt; Action = 'ToManyWaiting',1,0) &lt;B&gt;AS&lt;/B&gt; ExternalOverFlowToManyWaiting,&lt;/P&gt;&lt;P&gt;If(Action = 'TransferExternal' &lt;B&gt;OR&lt;/B&gt; Action = 'CalendarClosed',1,0) &lt;B&gt;AS&lt;/B&gt; ExternalOverFlowCalendar,&lt;/P&gt;&lt;P&gt;If(Action = 'TransferExternal' &lt;B&gt;OR&lt;/B&gt; Action = 'HolidayClosed',1,0) &lt;B&gt;AS&lt;/B&gt; ExternalOverFlowHoliday,&lt;/P&gt;&lt;P&gt;If(Action = 'TransferExternal' &lt;B&gt;OR&lt;/B&gt; Action = 'ManualClosed',1,0) &lt;B&gt;AS&lt;/B&gt; ExternalOverFlowManual,&lt;/P&gt;&lt;P&gt;If(Action = 'TransferExternal' &lt;B&gt;OR&lt;/B&gt; Action = 'NoAgent',1,0) &lt;B&gt;AS&lt;/B&gt; ExternalOverFlowNoAgent,&lt;/P&gt;&lt;P&gt;StartTime,&lt;/P&gt;&lt;P&gt;Floor(StartTime) &lt;B&gt;AS&lt;/B&gt; CallDate,&lt;/P&gt;&lt;P&gt;Hour(StartTime) &lt;B&gt;AS&lt;/B&gt; CallHour,&lt;/P&gt;&lt;P&gt;Minute(StartTime) &lt;B&gt;AS&lt;/B&gt; CallMinute,&lt;/P&gt;&lt;P&gt;Time(StartTime) &lt;B&gt;AS&lt;/B&gt; CallTime,&lt;/P&gt;&lt;P style="font-weight: bold"&gt;//Interval Setup&lt;/P&gt;&lt;P&gt;if ( minute(StartTime) &amp;lt; 30, '00', '30') &lt;B&gt;AS&lt;/B&gt; MinutesThirty,&lt;/P&gt;&lt;P&gt;if ( minute(StartTime) &amp;lt; 15, '00', if( minute(StartTime) &amp;lt; 30, '15', if( minute(StartTime) &amp;lt; 45, '30', '45' ))) &lt;B&gt;AS&lt;/B&gt; MinutesFifteen,&lt;/P&gt;&lt;P&gt;EndTime,&lt;/P&gt;&lt;P&gt;Duration,&lt;/P&gt;&lt;P style="font-weight: bold"&gt;//Wait Durration Variable&lt;/P&gt;&lt;P&gt;if(Action='Waiting',Duration,Null()) &lt;B&gt;AS&lt;/B&gt; WaitDuration,&lt;/P&gt;&lt;P&gt;SkillID,&lt;/P&gt;&lt;P&gt;CallerTitle,&lt;/P&gt;&lt;P&gt;CallerName,&lt;/P&gt;&lt;P&gt;CallerSureName,&lt;/P&gt;&lt;P&gt;CallerCompany,&lt;/P&gt;&lt;P&gt;CallerStreet,&lt;/P&gt;&lt;P&gt;CallerZIP,&lt;/P&gt;&lt;P&gt;CallerCity,&lt;/P&gt;&lt;P&gt;CallerCountry,&lt;/P&gt;&lt;P&gt;CallerPhone,&lt;/P&gt;&lt;P&gt;VIPClass &lt;B&gt;AS&lt;/B&gt; VIPClassID,&lt;/P&gt;&lt;P&gt;PhoneClass &lt;B&gt;AS&lt;/B&gt; PhoneClassID,&lt;/P&gt;&lt;P&gt;connected,&lt;/P&gt;&lt;P&gt;TransferID1,&lt;/P&gt;&lt;P&gt;TransferID2,&lt;/P&gt;&lt;P&gt;TransferID3,&lt;/P&gt;&lt;P&gt;TransferID4,&lt;/P&gt;&lt;P&gt;PhoneCallStart,&lt;/P&gt;&lt;P&gt;Classification,&lt;/P&gt;&lt;P&gt;PickedFromAgent;&lt;/P&gt;&lt;P&gt;&lt;B&gt;SQL&lt;/B&gt; &lt;B&gt;SELECT&lt;/B&gt; *&lt;/P&gt;&lt;P&gt;&lt;B&gt;FROM&lt;/B&gt; CCDB.dbo.InboundCallTracking WHERE ID &amp;gt; &lt;B&gt;&lt;I&gt;$(Successful)&lt;/I&gt;&lt;/B&gt;;&lt;/P&gt;&lt;P&gt;&lt;B&gt;END&lt;/B&gt; &lt;B&gt;IF&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;CONCATENATE&lt;/B&gt; &lt;B&gt;LOAD&lt;/B&gt; * &lt;B&gt;FROM&lt;/B&gt; &lt;B&gt;&lt;I&gt;$(QVDFILE)&lt;/I&gt;&lt;/B&gt; (qvd);&lt;/P&gt;&lt;P&gt;&lt;B&gt;STORE&lt;/B&gt; Inbound &lt;B&gt;INTO&lt;/B&gt; E:\QlikView\QlikView Data\QlikView Reports\MCC\QVDs\INBOUND.qvd;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help here or no any reason why I mite not be returning the last record ID?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Nov 2009 20:57:26 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-11-30T20:57:26Z</dc:date>
    <item>
      <title>Peek Function / Append Load</title>
      <link>https://community.qlik.com/t5/QlikView/Peek-Function-Append-Load/m-p/169192#M40082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I am creating a Append Load for my data using QVDs to speed up the reload time of my document.&lt;/P&gt;&lt;P&gt;I have successfully created the scrip which creates a QVD of the data and then concatenates any "new" data from the database onto the bottom of the QVD.&lt;/P&gt;&lt;P&gt;The problem I am having is with the Peek ( ) function. I am trying to select the last record in the QVD and store the ID into a variable which i will then use later to restrict the re-load from the database. (load everything after this ID)&lt;/P&gt;&lt;P&gt;Although where I am setting the variable, called "successful", equal to Peek(InboundCallTblID, &lt;STRONG&gt;-1&lt;/STRONG&gt; ,Inbound) using "-1" to select the last record of the QVD, the last record ID is not selected? I beleive it is selecting the first record ID in fact as if I remove the minus sign it returns the same ID?&lt;/P&gt;&lt;P&gt;Here is the code I have created:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;/*&lt;/B&gt; InboundCallTracking */&lt;/P&gt;&lt;P&gt;&lt;B&gt;SET&lt;/B&gt; QVDFILE = E:\QlikView\QlikView Data\QlikView Reports\MCC\QVDs\INBOUND.qvd;&lt;/P&gt;&lt;P&gt;&lt;B&gt;IF&lt;/B&gt; FileSize( &lt;B&gt;&lt;I&gt;'$(QVDFILE)'&lt;/I&gt;&lt;/B&gt; ) &amp;gt; 0 &lt;B&gt;THEN&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;SET&lt;/B&gt; QVD_Exists = 1;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;ELSE&lt;/P&gt;&lt;P&gt;&lt;B&gt;SET&lt;/B&gt; QVD_Exists = 0;&lt;/P&gt;&lt;P&gt;&lt;B&gt;END&lt;/B&gt; &lt;B&gt;IF&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;IF&lt;/B&gt; &lt;B&gt;&lt;I&gt;$(QVD_Exists)&lt;/I&gt;&lt;/B&gt; &lt;B&gt;THEN&lt;/B&gt;&lt;/P&gt;&lt;P style="font-style: italic"&gt;InboundQVD:&lt;/P&gt;&lt;P&gt;&lt;B&gt;LOAD&lt;/B&gt; * &lt;B&gt;FROM&lt;/B&gt; &lt;B&gt;&lt;I&gt;$(QVDFILE)&lt;/I&gt;&lt;/B&gt; (qvd);&lt;/P&gt;&lt;P&gt;&lt;B&gt;LET&lt;/B&gt; Successful = PEEK('InboundCallTrackingTblID',-1,'InboundQVD');&lt;/P&gt;&lt;P style="font-weight: bold"&gt;ELSE&lt;/P&gt;&lt;P&gt;&lt;B&gt;LET&lt;/B&gt; Successful = 0;&lt;/P&gt;&lt;P&gt;&lt;B&gt;END&lt;/B&gt; &lt;B&gt;IF&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;DROP&lt;/B&gt; &lt;B&gt;table&lt;/B&gt; &lt;I&gt;InboundQVD;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;IF&lt;/B&gt; &lt;B&gt;&lt;I&gt;$(Successful)&lt;/I&gt;&lt;/B&gt; &amp;gt; 0 &lt;B&gt;THEN&lt;/B&gt;&lt;/P&gt;&lt;P style="font-style: italic"&gt;Inbound:&lt;/P&gt;&lt;P&gt;&lt;B&gt;LOAD&lt;/B&gt;&lt;/P&gt;&lt;P&gt;ID &lt;B&gt;AS&lt;/B&gt; InboundCallTrackingTblID,&lt;/P&gt;&lt;P&gt;CallID,&lt;/P&gt;&lt;P&gt;CalledNumber,&lt;/P&gt;&lt;P&gt;CallerNumber,&lt;/P&gt;&lt;P&gt;AgentID,&lt;/P&gt;&lt;P&gt;Action,&lt;/P&gt;&lt;P style="font-weight: bold"&gt;//Wait Time Variables&lt;/P&gt;&lt;P&gt;If(Action = 'Connected' &lt;B&gt;OR&lt;/B&gt; Action = 'Voicemail' &lt;B&gt;OR&lt;/B&gt; Action = 'TransferInternal' &lt;B&gt;OR&lt;/B&gt; Action = 'TransferExternal',1,0) &lt;B&gt;AS&lt;/B&gt; Answered,&lt;/P&gt;&lt;P&gt;If(Action = 'Connected' &lt;B&gt;OR&lt;/B&gt; Action = 'TransferExternal',1,0) &lt;B&gt;AS&lt;/B&gt; AnsweredNoVoicemail,&lt;/P&gt;&lt;P&gt;If(Action &amp;lt;&amp;gt; 'Connected' &lt;B&gt;AND&lt;/B&gt; Action &amp;lt;&amp;gt; 'TransferExternal' &lt;B&gt;AND&lt;/B&gt; Action &amp;lt;&amp;gt; 'Voicemail' &lt;B&gt;AND&lt;/B&gt; Action &amp;lt;&amp;gt; 'TransferInternal',1,0) &lt;B&gt;AS&lt;/B&gt; Missed,&lt;/P&gt;&lt;P style="font-weight: bold"&gt;//Internal Overflow Variables&lt;/P&gt;&lt;P&gt;If(Action = 'TransferInternal' &lt;B&gt;OR&lt;/B&gt; Action = 'TimeOut',1,0) &lt;B&gt;AS&lt;/B&gt; InternalOverFlowTimeOut,&lt;/P&gt;&lt;P&gt;If(Action = 'TransferInternal' &lt;B&gt;OR&lt;/B&gt; Action = 'ToLongWaiting',1,0) &lt;B&gt;AS&lt;/B&gt; InternalOverFlowToLongWaiting,&lt;/P&gt;&lt;P&gt;If(Action = 'TransferInternal' &lt;B&gt;OR&lt;/B&gt; Action = 'ToManyWaiting',1,0) &lt;B&gt;AS&lt;/B&gt; InternalOverFlowToManyWaiting,&lt;/P&gt;&lt;P&gt;If(Action = 'TransferInternal' &lt;B&gt;OR&lt;/B&gt; Action = 'CalendarClosed',1,0) &lt;B&gt;AS&lt;/B&gt; InternalOverFlowCalendar,&lt;/P&gt;&lt;P&gt;If(Action = 'TransferInternal' &lt;B&gt;OR&lt;/B&gt; Action = 'HolidayClosed',1,0) &lt;B&gt;AS&lt;/B&gt; InternalOverFlowHoliday,&lt;/P&gt;&lt;P&gt;If(Action = 'TransferInternal' &lt;B&gt;OR&lt;/B&gt; Action = 'ManualClosed',1,0) &lt;B&gt;AS&lt;/B&gt; InternalOverFlowManual,&lt;/P&gt;&lt;P&gt;If(Action = 'TransferInternal' &lt;B&gt;OR&lt;/B&gt; Action = 'NoAgent',1,0) &lt;B&gt;AS&lt;/B&gt; InternalOverFlowNoAgent,&lt;/P&gt;&lt;P style="font-weight: bold"&gt;//External Overflow Variables&lt;/P&gt;&lt;P&gt;If(Action = 'TransferExternal' &lt;B&gt;OR&lt;/B&gt; Action = 'TimeOut',1,0) &lt;B&gt;AS&lt;/B&gt; ExternalOverFlowTimeOut,&lt;/P&gt;&lt;P&gt;If(Action = 'TransferExternal' &lt;B&gt;OR&lt;/B&gt; Action = 'ToLongWaiting',1,0) &lt;B&gt;AS&lt;/B&gt; ExternalOverFlowToLongWaiting,&lt;/P&gt;&lt;P&gt;If(Action = 'TransferExternal' &lt;B&gt;OR&lt;/B&gt; Action = 'ToManyWaiting',1,0) &lt;B&gt;AS&lt;/B&gt; ExternalOverFlowToManyWaiting,&lt;/P&gt;&lt;P&gt;If(Action = 'TransferExternal' &lt;B&gt;OR&lt;/B&gt; Action = 'CalendarClosed',1,0) &lt;B&gt;AS&lt;/B&gt; ExternalOverFlowCalendar,&lt;/P&gt;&lt;P&gt;If(Action = 'TransferExternal' &lt;B&gt;OR&lt;/B&gt; Action = 'HolidayClosed',1,0) &lt;B&gt;AS&lt;/B&gt; ExternalOverFlowHoliday,&lt;/P&gt;&lt;P&gt;If(Action = 'TransferExternal' &lt;B&gt;OR&lt;/B&gt; Action = 'ManualClosed',1,0) &lt;B&gt;AS&lt;/B&gt; ExternalOverFlowManual,&lt;/P&gt;&lt;P&gt;If(Action = 'TransferExternal' &lt;B&gt;OR&lt;/B&gt; Action = 'NoAgent',1,0) &lt;B&gt;AS&lt;/B&gt; ExternalOverFlowNoAgent,&lt;/P&gt;&lt;P&gt;StartTime,&lt;/P&gt;&lt;P&gt;Floor(StartTime) &lt;B&gt;AS&lt;/B&gt; CallDate,&lt;/P&gt;&lt;P&gt;Hour(StartTime) &lt;B&gt;AS&lt;/B&gt; CallHour,&lt;/P&gt;&lt;P&gt;Minute(StartTime) &lt;B&gt;AS&lt;/B&gt; CallMinute,&lt;/P&gt;&lt;P&gt;Time(StartTime) &lt;B&gt;AS&lt;/B&gt; CallTime,&lt;/P&gt;&lt;P style="font-weight: bold"&gt;//Interval Setup&lt;/P&gt;&lt;P&gt;if ( minute(StartTime) &amp;lt; 30, '00', '30') &lt;B&gt;AS&lt;/B&gt; MinutesThirty,&lt;/P&gt;&lt;P&gt;if ( minute(StartTime) &amp;lt; 15, '00', if( minute(StartTime) &amp;lt; 30, '15', if( minute(StartTime) &amp;lt; 45, '30', '45' ))) &lt;B&gt;AS&lt;/B&gt; MinutesFifteen,&lt;/P&gt;&lt;P&gt;EndTime,&lt;/P&gt;&lt;P&gt;Duration,&lt;/P&gt;&lt;P style="font-weight: bold"&gt;//Wait Durration Variable&lt;/P&gt;&lt;P&gt;if(Action='Waiting',Duration,Null()) &lt;B&gt;AS&lt;/B&gt; WaitDuration,&lt;/P&gt;&lt;P&gt;SkillID,&lt;/P&gt;&lt;P&gt;CallerTitle,&lt;/P&gt;&lt;P&gt;CallerName,&lt;/P&gt;&lt;P&gt;CallerSureName,&lt;/P&gt;&lt;P&gt;CallerCompany,&lt;/P&gt;&lt;P&gt;CallerStreet,&lt;/P&gt;&lt;P&gt;CallerZIP,&lt;/P&gt;&lt;P&gt;CallerCity,&lt;/P&gt;&lt;P&gt;CallerCountry,&lt;/P&gt;&lt;P&gt;CallerPhone,&lt;/P&gt;&lt;P&gt;VIPClass &lt;B&gt;AS&lt;/B&gt; VIPClassID,&lt;/P&gt;&lt;P&gt;PhoneClass &lt;B&gt;AS&lt;/B&gt; PhoneClassID,&lt;/P&gt;&lt;P&gt;connected,&lt;/P&gt;&lt;P&gt;TransferID1,&lt;/P&gt;&lt;P&gt;TransferID2,&lt;/P&gt;&lt;P&gt;TransferID3,&lt;/P&gt;&lt;P&gt;TransferID4,&lt;/P&gt;&lt;P&gt;PhoneCallStart,&lt;/P&gt;&lt;P&gt;Classification,&lt;/P&gt;&lt;P&gt;PickedFromAgent;&lt;/P&gt;&lt;P&gt;&lt;B&gt;SQL&lt;/B&gt; &lt;B&gt;SELECT&lt;/B&gt; *&lt;/P&gt;&lt;P&gt;&lt;B&gt;FROM&lt;/B&gt; CCDB.dbo.InboundCallTracking WHERE ID &amp;gt; &lt;B&gt;&lt;I&gt;$(Successful)&lt;/I&gt;&lt;/B&gt;;&lt;/P&gt;&lt;P&gt;&lt;B&gt;END&lt;/B&gt; &lt;B&gt;IF&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;CONCATENATE&lt;/B&gt; &lt;B&gt;LOAD&lt;/B&gt; * &lt;B&gt;FROM&lt;/B&gt; &lt;B&gt;&lt;I&gt;$(QVDFILE)&lt;/I&gt;&lt;/B&gt; (qvd);&lt;/P&gt;&lt;P&gt;&lt;B&gt;STORE&lt;/B&gt; Inbound &lt;B&gt;INTO&lt;/B&gt; E:\QlikView\QlikView Data\QlikView Reports\MCC\QVDs\INBOUND.qvd;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help here or no any reason why I mite not be returning the last record ID?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Nov 2009 20:57:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Peek-Function-Append-Load/m-p/169192#M40082</guid>
      <dc:creator />
      <dc:date>2009-11-30T20:57:26Z</dc:date>
    </item>
    <item>
      <title>Re: Peek Function / Append Load</title>
      <link>https://community.qlik.com/t5/QlikView/Peek-Function-Append-Load/m-p/169193#M40083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would suspect that the peek function no longer has a 'last record read' associated with it because you have finished your load statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your record IDs are sequential, (as suggested by the fact that you can use 'Successful' as the start point of your select statement) then I would suggest either:&lt;/P&gt;&lt;P&gt;if starting from 1: &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LET&lt;/STRONG&gt; Successful = QvdNoOfRecords( &lt;STRONG&gt;&lt;EM&gt;'$(QVDFILE)'&lt;/EM&gt;&lt;/STRONG&gt; ) &lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;if starting from some arbitrary number and you haven't got the field loaded with more values elsewhere previously:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LET&lt;/STRONG&gt; Successful = max( InboundCallTrackingTblID) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Note: neither code has been tested as I have nothing eqivalent to test against)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: as an afterthought, it might be sufficient to move your peek to above your load statement (load on load logic)?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2011 14:09:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Peek-Function-Append-Load/m-p/169193#M40083</guid>
      <dc:creator />
      <dc:date>2011-11-02T14:09:38Z</dc:date>
    </item>
  </channel>
</rss>

