<?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: Error correction - missing date in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Error-correction-missing-date-in-script/m-p/900094#M659889</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rod&lt;/P&gt;&lt;P&gt;thank you for your helpr, finally figured it out using peek, but despite that same solution as yours.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Apr 2015 09:39:38 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-04-14T09:39:38Z</dc:date>
    <item>
      <title>Error correction - missing date in script</title>
      <link>https://community.qlik.com/t5/QlikView/Error-correction-missing-date-in-script/m-p/900091#M659886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good morning,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have a problem with an inconsistent data source of HR data from excel files. Because these files are exported from a third party software there is no chance so far to fix the problem in near future, so i wanted to correct the data during the script load.&lt;/P&gt;&lt;P&gt;I just dont really know how and hope anyone could give me helpful input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get a list of employees every month containing following columns&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ActualPeriod, EmployeeID, EntryDate, RetirementDate, EmploymentRelationShip, EmpRelStartDate, EmpRelEndDate ... and several HR data not relevant for this problem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RetirementDate and EmpRelEnddate can be null if the employee has an active employment or no changes with his employment. But under certain conditions the employment type changes and he gets a second record in the data but the "older" record does not have an EmpRelEndDate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;LOAD * INLINE&lt;/P&gt;&lt;P&gt;[Period, EmployeeID, EntryDate, RetirementDate, EmploymentRelationShip, EmpRelStartDate, EmpRelEndDate&lt;/P&gt;&lt;P&gt;201501, 1, '01.01.2012', , 'apprentice', '01.01.2012',&lt;/P&gt;&lt;P&gt;201502, 1, '01.01.2012',, 'apprentice', '01.01.2012',&lt;/P&gt;&lt;P&gt;201502, 1, '01.01.2012',, 'employee', '15.02.2015',&lt;/P&gt;&lt;P&gt;201503, 1, '01.01.2012',, 'employee', '15.02.2015',&lt;/P&gt;&lt;P&gt;201501, 2, '01.01.2014',, 'employee', '01.01.2014',&lt;/P&gt;&lt;P&gt;201502, 2, '01.01.2014',, 'employee', '01.01.2014',&lt;/P&gt;&lt;P&gt;201503, 2, '01.01.2014',, 'employee', '01.01.2014',&lt;/P&gt;&lt;P&gt;201501, 3, '01.01.2013',, 'employee', '01.01.2013',&lt;/P&gt;&lt;P&gt;201502, 3, '01.01.2013','30.04.2015', 'employee', '01.01.2013', '30.04.2015'&lt;/P&gt;&lt;P&gt;201503, 3, '01.01.2013','30.04.2015', 'employee', '01.01.2013', '30.04.2015'];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the third line #1 switches from apprentice to employee and the apprentice date should end with 14.2.2015 but the date is missing in the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any way how i can check the data during script execution und fill missing dates with next starting date -1 of the same EmployeeID ? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Apr 2015 08:19:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-correction-missing-date-in-script/m-p/900091#M659886</guid>
      <dc:creator />
      <dc:date>2015-04-13T08:19:00Z</dc:date>
    </item>
    <item>
      <title>Re: Error correction - missing date in script</title>
      <link>https://community.qlik.com/t5/QlikView/Error-correction-missing-date-in-script/m-p/900092#M659887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think i got it as long as i can guarantee the correct sort order .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anyone looking for a similar task:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(EmployeeID = peek('EmployeeID') and isnull(EmpRelEndDate) AND EmpRelStartDate &amp;lt;&amp;gt; peek('EmpRelStartDate'), &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; date(peek('EmpRelStartDate')-1), &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EmpRelEndDate) as NewEnd&lt;/P&gt;&lt;P&gt;Resident TEST&lt;/P&gt;&lt;P&gt;Order by&amp;nbsp; EmployeeID, EmpRelStartDate desc, Period desc;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Apr 2015 09:55:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-correction-missing-date-in-script/m-p/900092#M659887</guid>
      <dc:creator />
      <dc:date>2015-04-13T09:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: Error correction - missing date in script</title>
      <link>https://community.qlik.com/t5/QlikView/Error-correction-missing-date-in-script/m-p/900093#M659888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Markus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a really simple example of what I think you are trying to do, for this example I have created a new field called NewEmpRelEndDate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rod&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Apr 2015 10:43:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-correction-missing-date-in-script/m-p/900093#M659888</guid>
      <dc:creator />
      <dc:date>2015-04-13T10:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: Error correction - missing date in script</title>
      <link>https://community.qlik.com/t5/QlikView/Error-correction-missing-date-in-script/m-p/900094#M659889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rod&lt;/P&gt;&lt;P&gt;thank you for your helpr, finally figured it out using peek, but despite that same solution as yours.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Apr 2015 09:39:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-correction-missing-date-in-script/m-p/900094#M659889</guid>
      <dc:creator />
      <dc:date>2015-04-14T09:39:38Z</dc:date>
    </item>
  </channel>
</rss>

