<?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: What's wrong with this LOAD? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/What-s-wrong-with-this-LOAD/m-p/1356482#M619478</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I got it working. I had to stop using the EmpDataTemp table name and just use HRMS_EMP everywhere and trust Qlik to concatenate the data properly. I also had to stop QUALIFYING all but the final load from the QVD, which seemed to fix the Table-1, Table-2, etc... issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;********************************************************************************************************************&lt;/P&gt;&lt;P&gt;vProcDate=vStartDate // Use Default Start Date from Config. Could change below if QVD exists.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Check to see if EmpQVD Exists and load if it does&lt;/P&gt;&lt;P&gt;LET vTest=FileTime(vEmpQVD);&lt;/P&gt;&lt;P&gt;LET vEmpQVDExists = isnull(FileTime(vEmpQVD));&amp;nbsp; // if qvd exists then 0 else -1&lt;/P&gt;&lt;P&gt;IF $(vEmpQVDExists)=0 THEN &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Load Contents of Current Employee QVD into Temp Table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; HRMS_EMP:&lt;/P&gt;&lt;P&gt;&amp;nbsp; LOAD * FROM $(vEmpQVD) (qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Update the Start Date based on the last update in the QVD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Get last HRMS_UPDATE_DATE from HRMS+. Not sure yet if I'm going to use this.&lt;/P&gt;&lt;P&gt;&amp;nbsp; Temp:&lt;/P&gt;&lt;P&gt;&amp;nbsp; Load LAST_UPDATE as MaxValue;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SQL SELECT MAX(HRMS_AS_OF_DATE) as LAST_UPDATE FROM fn_getEmpCoreAttributes(getdate(), default, default);&lt;/P&gt;&lt;P&gt;&amp;nbsp; Let vLastHRMSUpdateDate=FieldValue('MaxValue',1);&lt;/P&gt;&lt;P&gt;&amp;nbsp; Drop Table Temp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Get last HRMS_UPDATE_DATE from HRMS_EMP&lt;/P&gt;&lt;P&gt;&amp;nbsp; Temp:&lt;/P&gt;&lt;P&gt;&amp;nbsp; //Load Max(EmpDataTemp.HRMS_AS_OF_DATE) AS MaxValue RESIDENT EmpDataTemp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Load Max(HRMS_AS_OF_DATE) AS MaxValue RESIDENT HRMS_EMP;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Let vLastQVDUpdateDate=FieldValue('MaxValue',1);&lt;/P&gt;&lt;P&gt;&amp;nbsp; Drop Table Temp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //Set the Process Start Date to the last day in the QVD&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vProcDate=vLastQVDUpdateDate;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO WHILE vProcDate&amp;lt;Today()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //Where conditions using the HRMS+ IRS&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vFromExpr='HRMSInterface.dbo.fn_getEmpCoreAttributes(' &amp;amp; Chr(39) &amp;amp; Date(vProcDate, 'MM/D/YYYY') &amp;amp; Chr(39) &amp;amp; ',default,default)';&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vFromExpr=vFromExpr &amp;amp;&amp;nbsp; ' WHERE CAST(UPDATED_DATE AS DATE)=' &amp;amp; Chr(39) &amp;amp; Date(vProcDate, 'MM/D/YYYY') &amp;amp; Chr(39); //Adds clause to only pull the modified entries from this date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; HRMS_EMP:&lt;/P&gt;&lt;P&gt;&amp;nbsp; LOAD HRMS_AS_OF_DATE,&lt;/P&gt;&lt;P&gt;&amp;nbsp; PERSON_ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp; COMPANY_CODE,&lt;/P&gt;&lt;P&gt;&amp;nbsp; EMPLOYEE_ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp; FULL_NAME,&lt;/P&gt;&lt;P&gt;&amp;nbsp; FIRST_NAME,&lt;/P&gt;&lt;P&gt;&amp;nbsp; MIDDLE_NAME,&lt;/P&gt;&lt;P&gt;&amp;nbsp; LAST_NAME&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SQL SELECT HRMS_AS_OF_DATE,&lt;/P&gt;&lt;P&gt;&amp;nbsp; PERSON_ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp; COMPANY_CODE,&lt;/P&gt;&lt;P&gt;&amp;nbsp; EMPLOYEE_ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp; FULL_NAME,&lt;/P&gt;&lt;P&gt;&amp;nbsp; FIRST_NAME,&lt;/P&gt;&lt;P&gt;&amp;nbsp; MIDDLE_NAME,&lt;/P&gt;&lt;P&gt;&amp;nbsp; LAST_NAME&lt;/P&gt;&lt;P&gt;&amp;nbsp; FROM $(vFromExpr)&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //Let vProcDate=MonthEnd(AddMonths(vProcDate,1)); //Increment Processing Date by 1 Month&lt;/P&gt;&lt;P&gt;&amp;nbsp; Let vProcDate=vProcDate+1; //Increment Processing Date by Day&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Store the tables into QVD file &lt;/P&gt;&lt;P&gt;STORE HRMS_EMP INTO $(vEmpQVD) (qvd);&lt;/P&gt;&lt;P&gt;DROP Table HRMS_EMP;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Reload the QVD File with the working Table Name&lt;/P&gt;&lt;P&gt;QUALIFY *;&lt;/P&gt;&lt;P&gt;UNQUALIFY EMPLOYEE_ID, MGR_ID1;&lt;/P&gt;&lt;P&gt;HRMS_EMP:&lt;/P&gt;&lt;P&gt;LOAD * from $(vEmpQVD) (qvd);&lt;/P&gt;&lt;P&gt;UNQUALIFY *;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Apr 2017 17:55:08 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-04-07T17:55:08Z</dc:date>
    <item>
      <title>What's wrong with this LOAD?</title>
      <link>https://community.qlik.com/t5/QlikView/What-s-wrong-with-this-LOAD/m-p/1356479#M619475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I load a table from a QVD:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;QUALIFY *;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;UNQUALIFY EMPLOYEE_ID, MGR_ID1;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;EmpDataTemp:&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;LOAD * FROM $(vEmpQVD) (qvd);&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;UNQUALIFY *;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That works fine. The QVD has a field called HRMS_AS_OF_DATE. I want to populate a variable in my load script with the Max value of this field. So, I do this (based on other posts I've found here):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;Temp:&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;Load Max(EmpDataTemp.HRMS_AS_OF_DATE) AS MaxValue RESIDENT EmpDataTemp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;Let vLastQVDUpdateDate=FieldValue('MaxValue',1);&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;Drop Table Temp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried this w/ and w/o fully qualifying the Table Name as part of the field, but I keep getting an error that the HRMS_AS_OF_DATE is not a valid field name, and I'm not sure why...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone see anything wrong with this? Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Apr 2017 14:11:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-s-wrong-with-this-LOAD/m-p/1356479#M619475</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-04-06T14:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: What's wrong with this LOAD?</title>
      <link>https://community.qlik.com/t5/QlikView/What-s-wrong-with-this-LOAD/m-p/1356480#M619476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Make sure your qvd file really has a field with the &lt;STRONG&gt;exact &lt;/STRONG&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;name &lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;HRMS_AS_OF_DATE. Note that Qlikview is case sensitive with regards to field names. That means &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt; &lt;EM&gt;HRMS_AS_OF_DATE&lt;/EM&gt;, &lt;EM&gt;hrms_as_of_date&lt;/EM&gt; and &lt;EM&gt;Hrms_As_Of_Date&lt;/EM&gt; are three different fields.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Apr 2017 17:37:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-s-wrong-with-this-LOAD/m-p/1356480#M619476</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2017-04-06T17:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: What's wrong with this LOAD?</title>
      <link>https://community.qlik.com/t5/QlikView/What-s-wrong-with-this-LOAD/m-p/1356481#M619477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply. Maybe it'll help if I include the whole script....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, I'm trying to do an incremental load. The first run-through works and creates a qualified field name of HRMS_EMP.HRMS_AS_OF_DATE. Once the QVD is created, on the next run I want to load the deltas into the table HRMS_EMP table and store them in the QVD. The IF statement determines the start date of the loop based on the last &lt;SPAN style="font-size: 13.3333px;"&gt;HRMS_AS_OF_DATE&lt;/SPAN&gt; from the data loaded from the QVD. With the script as-is below, I think I end up with 2 sets of fields in the table - one set qualified as HRMS_EMP.xxx and the other as EmpDataTemp.xxx, (I truncated the list of fields, but you get the idea...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to loop through the SQL by date because I'm using a function to build a slowly changing dimensions table, and the function only gives data as per a certain date. I think maybe it has something to do with my table names and the loop and the fact that I'm not qualifying the field names, but if I qualify the field names in the loop I end up with multiple temp tables (&lt;SPAN style="font-size: 13.3333px;"&gt;EmpDataTemp&lt;/SPAN&gt;-1. &lt;SPAN style="font-size: 13.3333px;"&gt;EmpDataTemp&lt;/SPAN&gt;-2, etc...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, maybe I'm going about this wrong? TIA for any pointers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//*******************************************&lt;/P&gt;&lt;P&gt;vProcDate=vStartDate // Use Default Start Date from Config. Could change below if QVD exists.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Check to see if EmpQVD Exists and load if it does&lt;/P&gt;&lt;P&gt;LET vTest=FileTime(vEmpQVD);&lt;/P&gt;&lt;P&gt;LET vEmpQVDExists = isnull(FileTime(vEmpQVD));&amp;nbsp; // if qvd exists then 0 else -1&lt;/P&gt;&lt;P&gt;IF $(vEmpQVDExists)=0 THEN &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Load Contents of Current Employee QVD into Temp Table&lt;/P&gt;&lt;P&gt;&amp;nbsp; QUALIFY *;&lt;/P&gt;&lt;P&gt;&amp;nbsp; UNQUALIFY EMPLOYEE_ID, MGR_ID1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; EmpDataTemp:&lt;/P&gt;&lt;P&gt;&amp;nbsp; LOAD * FROM $(vEmpQVD) (qvd);&lt;/P&gt;&lt;P&gt;&amp;nbsp; UNQUALIFY *;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //EXIT SCRIPT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Update the Start Date based on the last update in the QVD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Get last HRMS_UPDATE_DATE from HRMS+. Not sure yet if I'm going to use this.&lt;/P&gt;&lt;P&gt;&amp;nbsp; Temp:&lt;/P&gt;&lt;P&gt;&amp;nbsp; Load LAST_UPDATE as MaxValue;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SQL SELECT MAX(HRMS_AS_OF_DATE) as LAST_UPDATE FROM fn_getEmpCoreAttributes(getdate(), default, default);&lt;/P&gt;&lt;P&gt;&amp;nbsp; Let vLastHRMSUpdateDate=FieldValue('MaxValue',1);&lt;/P&gt;&lt;P&gt;&amp;nbsp; Drop Table Temp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //EXIT Script;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Get last HRMS_UPDATE_DATE from HRMS_EMP&lt;/P&gt;&lt;P&gt;&amp;nbsp; Temp:&lt;/P&gt;&lt;P&gt;&amp;nbsp; Load Max(EmpDataTemp.HRMS_AS_OF_DATE) AS MaxValue RESIDENT EmpDataTemp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Let vLastQVDUpdateDate=FieldValue('MaxValue',1);&lt;/P&gt;&lt;P&gt;&amp;nbsp; Drop Table Temp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //Set the Process Start Date to the last day in the QVD&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vProcDate=vLastQVDUpdateDate;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO WHILE vProcDate&amp;lt;Today()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //Where conditions using the HRMS+ IRS&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vFromExpr='HRMSInterface.dbo.fn_getEmpCoreAttributes(' &amp;amp; Chr(39) &amp;amp; Date(vProcDate, 'MM/D/YYYY') &amp;amp; Chr(39) &amp;amp; ',default,default)';&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vFromExpr=vFromExpr &amp;amp;&amp;nbsp; ' WHERE CAST(UPDATED_DATE AS DATE)=' &amp;amp; Chr(39) &amp;amp; Date(vProcDate, 'MM/D/YYYY') &amp;amp; Chr(39); //Adds clause to only pull the modified entries from this date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// QUALIFY *;&lt;/P&gt;&lt;P&gt;// UNQUALIFY EMPLOYEE_ID, MGR_ID1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; EmpDataTemp:&lt;/P&gt;&lt;P&gt;&amp;nbsp; LOAD HRMS_AS_OF_DATE,&lt;/P&gt;&lt;P&gt;&amp;nbsp; PERSON_ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp; COMPANY_CODE,&lt;/P&gt;&lt;P&gt;&amp;nbsp; EMPLOYEE_ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp; FULL_NAME,&lt;/P&gt;&lt;P&gt;&amp;nbsp; FIRST_NAME,&lt;/P&gt;&lt;P&gt;&amp;nbsp; MIDDLE_NAME,&lt;/P&gt;&lt;P&gt;&amp;nbsp; LAST_NAME,&lt;/P&gt;&lt;P&gt;&amp;nbsp; MGR_ID1&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SQL SELECT HRMS_AS_OF_DATE,&lt;/P&gt;&lt;P&gt;&amp;nbsp; PERSON_ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp; COMPANY_CODE,&lt;/P&gt;&lt;P&gt;&amp;nbsp; EMPLOYEE_ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp; FULL_NAME,&lt;/P&gt;&lt;P&gt;&amp;nbsp; FIRST_NAME,&lt;/P&gt;&lt;P&gt;&amp;nbsp; MIDDLE_NAME,&lt;/P&gt;&lt;P&gt;&amp;nbsp; LAST_NAME,&lt;/P&gt;&lt;P&gt;&amp;nbsp; MGR_PERSON_ID1 AS MGR_ID1&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 10pt;"&gt;FROM $(vFromExpr)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;// UNQUALIFY *;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; STORE EmpDataTemp INTO $(vEmpQVD) (qvd);&lt;/P&gt;&lt;P&gt;&amp;nbsp; DROP Table EmpDataTemp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //Let vProcDate=MonthEnd(AddMonths(vProcDate,1)); //Increment Processing Date by 1 Month&lt;/P&gt;&lt;P&gt;&amp;nbsp; Let vProcDate=vProcDate+1; //Increment Processing Date by Day&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Store the Temp tables into QVD file and Drop the Temp table&lt;/P&gt;&lt;P&gt;STORE EmpDataTemp INTO $(vEmpQVD) (qvd);&lt;/P&gt;&lt;P&gt;DROP Table EmpDataTemp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Reload the QVD File with the working Table Name&lt;/P&gt;&lt;P&gt;QUALIFY *;&lt;/P&gt;&lt;P&gt;UNQUALIFY EMPLOYEE_ID, MGR_ID1;&lt;/P&gt;&lt;P&gt;HRMS_EMP:&lt;/P&gt;&lt;P&gt;LOAD * from $(vEmpQVD) (qvd);&lt;/P&gt;&lt;P&gt;UNQUALIFY *;&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;EXIT SCRIPT;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Apr 2017 13:05:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-s-wrong-with-this-LOAD/m-p/1356481#M619477</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-04-07T13:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: What's wrong with this LOAD?</title>
      <link>https://community.qlik.com/t5/QlikView/What-s-wrong-with-this-LOAD/m-p/1356482#M619478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I got it working. I had to stop using the EmpDataTemp table name and just use HRMS_EMP everywhere and trust Qlik to concatenate the data properly. I also had to stop QUALIFYING all but the final load from the QVD, which seemed to fix the Table-1, Table-2, etc... issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;********************************************************************************************************************&lt;/P&gt;&lt;P&gt;vProcDate=vStartDate // Use Default Start Date from Config. Could change below if QVD exists.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Check to see if EmpQVD Exists and load if it does&lt;/P&gt;&lt;P&gt;LET vTest=FileTime(vEmpQVD);&lt;/P&gt;&lt;P&gt;LET vEmpQVDExists = isnull(FileTime(vEmpQVD));&amp;nbsp; // if qvd exists then 0 else -1&lt;/P&gt;&lt;P&gt;IF $(vEmpQVDExists)=0 THEN &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Load Contents of Current Employee QVD into Temp Table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; HRMS_EMP:&lt;/P&gt;&lt;P&gt;&amp;nbsp; LOAD * FROM $(vEmpQVD) (qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Update the Start Date based on the last update in the QVD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Get last HRMS_UPDATE_DATE from HRMS+. Not sure yet if I'm going to use this.&lt;/P&gt;&lt;P&gt;&amp;nbsp; Temp:&lt;/P&gt;&lt;P&gt;&amp;nbsp; Load LAST_UPDATE as MaxValue;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SQL SELECT MAX(HRMS_AS_OF_DATE) as LAST_UPDATE FROM fn_getEmpCoreAttributes(getdate(), default, default);&lt;/P&gt;&lt;P&gt;&amp;nbsp; Let vLastHRMSUpdateDate=FieldValue('MaxValue',1);&lt;/P&gt;&lt;P&gt;&amp;nbsp; Drop Table Temp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Get last HRMS_UPDATE_DATE from HRMS_EMP&lt;/P&gt;&lt;P&gt;&amp;nbsp; Temp:&lt;/P&gt;&lt;P&gt;&amp;nbsp; //Load Max(EmpDataTemp.HRMS_AS_OF_DATE) AS MaxValue RESIDENT EmpDataTemp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Load Max(HRMS_AS_OF_DATE) AS MaxValue RESIDENT HRMS_EMP;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Let vLastQVDUpdateDate=FieldValue('MaxValue',1);&lt;/P&gt;&lt;P&gt;&amp;nbsp; Drop Table Temp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //Set the Process Start Date to the last day in the QVD&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vProcDate=vLastQVDUpdateDate;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO WHILE vProcDate&amp;lt;Today()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //Where conditions using the HRMS+ IRS&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vFromExpr='HRMSInterface.dbo.fn_getEmpCoreAttributes(' &amp;amp; Chr(39) &amp;amp; Date(vProcDate, 'MM/D/YYYY') &amp;amp; Chr(39) &amp;amp; ',default,default)';&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vFromExpr=vFromExpr &amp;amp;&amp;nbsp; ' WHERE CAST(UPDATED_DATE AS DATE)=' &amp;amp; Chr(39) &amp;amp; Date(vProcDate, 'MM/D/YYYY') &amp;amp; Chr(39); //Adds clause to only pull the modified entries from this date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; HRMS_EMP:&lt;/P&gt;&lt;P&gt;&amp;nbsp; LOAD HRMS_AS_OF_DATE,&lt;/P&gt;&lt;P&gt;&amp;nbsp; PERSON_ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp; COMPANY_CODE,&lt;/P&gt;&lt;P&gt;&amp;nbsp; EMPLOYEE_ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp; FULL_NAME,&lt;/P&gt;&lt;P&gt;&amp;nbsp; FIRST_NAME,&lt;/P&gt;&lt;P&gt;&amp;nbsp; MIDDLE_NAME,&lt;/P&gt;&lt;P&gt;&amp;nbsp; LAST_NAME&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SQL SELECT HRMS_AS_OF_DATE,&lt;/P&gt;&lt;P&gt;&amp;nbsp; PERSON_ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp; COMPANY_CODE,&lt;/P&gt;&lt;P&gt;&amp;nbsp; EMPLOYEE_ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp; FULL_NAME,&lt;/P&gt;&lt;P&gt;&amp;nbsp; FIRST_NAME,&lt;/P&gt;&lt;P&gt;&amp;nbsp; MIDDLE_NAME,&lt;/P&gt;&lt;P&gt;&amp;nbsp; LAST_NAME&lt;/P&gt;&lt;P&gt;&amp;nbsp; FROM $(vFromExpr)&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //Let vProcDate=MonthEnd(AddMonths(vProcDate,1)); //Increment Processing Date by 1 Month&lt;/P&gt;&lt;P&gt;&amp;nbsp; Let vProcDate=vProcDate+1; //Increment Processing Date by Day&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Store the tables into QVD file &lt;/P&gt;&lt;P&gt;STORE HRMS_EMP INTO $(vEmpQVD) (qvd);&lt;/P&gt;&lt;P&gt;DROP Table HRMS_EMP;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Reload the QVD File with the working Table Name&lt;/P&gt;&lt;P&gt;QUALIFY *;&lt;/P&gt;&lt;P&gt;UNQUALIFY EMPLOYEE_ID, MGR_ID1;&lt;/P&gt;&lt;P&gt;HRMS_EMP:&lt;/P&gt;&lt;P&gt;LOAD * from $(vEmpQVD) (qvd);&lt;/P&gt;&lt;P&gt;UNQUALIFY *;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Apr 2017 17:55:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-s-wrong-with-this-LOAD/m-p/1356482#M619478</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-04-07T17:55:08Z</dc:date>
    </item>
  </channel>
</rss>

