<?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 Personell data - employees adopted in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Personell-data-employees-adopted/m-p/479198#M1269587</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 just talked to a contact person from HR in my company:&lt;/P&gt;&lt;P&gt;I have built a Dashboard displaying various values concerning our personell, among them the employees adopted (who began as contract workers and became permanent employees eventually).&lt;/P&gt;&lt;P&gt;I will post here the script code I currently use.&lt;/P&gt;&lt;P&gt;Needless to say, the result is wrong - that does not necessarily mean my calculation is wrong, but I'd like to be sure about that.&lt;/P&gt;&lt;P&gt;The thing is quite complex, with a series of RESIDENT LOADs and JOINs - so an error somewhere is quite possible.&lt;/P&gt;&lt;P&gt;Could anybody please have a look at this and tell me whether something meets your eye as wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// First comes a general LOAD from the database of a load of data concerning personell (all the employees who were&lt;BR /&gt;// with the company until three months back at least);&lt;/P&gt;&lt;P&gt;MA_Grunddaten:&lt;BR /&gt;LOAD&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pnr as Pers_Nr4,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TRIM(vname) &amp;amp; TRIM(nname) as Name,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; makz as Kennz,&lt;BR /&gt;WHERE ((RIGHT(datumbis, 2) &amp;amp; '.' &amp;amp; MID(datumbis, 5, 2) &amp;amp; '.' &amp;amp; LEFT(datumbis, 4)) &amp;gt;= Monthstart(TODAY(), -3));&lt;/P&gt;&lt;P&gt;// Then I add a counter to that base_table - when an employee is adopted, the name stays the same,&lt;BR /&gt;// but he is assigned another personell_number.&lt;/P&gt;&lt;P&gt;LEFT JOIN (MA_Grunddaten)&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; COUNT(Pers_Nr4) as ID_count&lt;BR /&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp; COUNT(Kennz) as Kennz_count&lt;BR /&gt;RESIDENT MA_Grunddaten&lt;BR /&gt;&amp;nbsp; GROUP BY Name&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Übernahmen_pre:&lt;BR /&gt;LOAD&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Pers_Nr4,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Kennz,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Eintritt&lt;BR /&gt;RESIDENT MA_Grunddaten&lt;BR /&gt; WHERE&amp;nbsp; ID_count &amp;gt; 1&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;// Every employee now has two "join_dates" ("Eintritt"): The date the employee first joined the company&lt;BR /&gt;// AND the date he/she was adopted. I need only the latter.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;LEFT JOIN (Übernahmen_pre)&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATE(max(Eintritt)) as Datum_Übernahme&lt;BR /&gt;Resident Übernahmen_pre&lt;BR /&gt; GROUP BY Name&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;// Next, I want to make sure I grab only employees who have two records with two different type_flags - usually, when&lt;BR /&gt;// a contract worker is adopted, his/her type_flag changes, but there are exceptions.&lt;/P&gt;&lt;P&gt;Übernahmen_pre2:&lt;BR /&gt;LOAD&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COUNT(DISTINCT Kennz) as Kennz_count&lt;BR /&gt;RESIDENT Übernahmen_pre&lt;BR /&gt;&amp;nbsp; GROUP BY Name&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;LEFT JOIN (Übernahmen_pre)&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Kennz_count&lt;BR /&gt;RESIDENT Übernahmen_pre2&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;// Now the actual work is done - only the resulting tables has both records for every employee who was adopted&lt;BR /&gt;// (both with the later date, the date of his/her adoption), so we use the MOD() function to grab only every other record.&lt;/P&gt;&lt;P&gt;DROP TABLE Übernahmen_pre2;&lt;/P&gt;&lt;P&gt;Übernahmen_pre3:&lt;BR /&gt;LOAD&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RecNo() as Row_ID,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Datum_Übernahme&lt;BR /&gt;RESIDENT Übernahmen_pre&lt;BR /&gt;&amp;nbsp; WHERE Kennz_count &amp;gt; 1&lt;BR /&gt;;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;DROP TABLE Übernahmen_pre;&lt;/P&gt;&lt;P&gt;// In dieser Tabelle haben wir im Prinzip schon das richtige, aber wir brauchen nur jeden zweiten Datensatz.&lt;BR /&gt;// Deshalb nehmen wir mithilfe der MOD-Fkt nur die geraden Datensätze raus (jew. den zweiten).&lt;/P&gt;&lt;P&gt;Übernahmen:&lt;BR /&gt;LOAD&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Datum_Übernahme,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Datum_Übernahme as %Datum,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month(Datum_Übernahme) as Übernahmemonat,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year(Datum_Übernahme) as Übernahmejahr&lt;BR /&gt;RESIDENT Übernahmen_pre3&lt;BR /&gt;&amp;nbsp; WHERE Mod(Row_ID, 2)=0&lt;BR /&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Jan 2026 18:19:17 GMT</pubDate>
    <dc:creator>datanibbler</dc:creator>
    <dc:date>2026-01-26T18:19:17Z</dc:date>
    <item>
      <title>Personell data - employees adopted</title>
      <link>https://community.qlik.com/t5/QlikView/Personell-data-employees-adopted/m-p/479198#M1269587</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 just talked to a contact person from HR in my company:&lt;/P&gt;&lt;P&gt;I have built a Dashboard displaying various values concerning our personell, among them the employees adopted (who began as contract workers and became permanent employees eventually).&lt;/P&gt;&lt;P&gt;I will post here the script code I currently use.&lt;/P&gt;&lt;P&gt;Needless to say, the result is wrong - that does not necessarily mean my calculation is wrong, but I'd like to be sure about that.&lt;/P&gt;&lt;P&gt;The thing is quite complex, with a series of RESIDENT LOADs and JOINs - so an error somewhere is quite possible.&lt;/P&gt;&lt;P&gt;Could anybody please have a look at this and tell me whether something meets your eye as wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// First comes a general LOAD from the database of a load of data concerning personell (all the employees who were&lt;BR /&gt;// with the company until three months back at least);&lt;/P&gt;&lt;P&gt;MA_Grunddaten:&lt;BR /&gt;LOAD&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pnr as Pers_Nr4,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TRIM(vname) &amp;amp; TRIM(nname) as Name,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; makz as Kennz,&lt;BR /&gt;WHERE ((RIGHT(datumbis, 2) &amp;amp; '.' &amp;amp; MID(datumbis, 5, 2) &amp;amp; '.' &amp;amp; LEFT(datumbis, 4)) &amp;gt;= Monthstart(TODAY(), -3));&lt;/P&gt;&lt;P&gt;// Then I add a counter to that base_table - when an employee is adopted, the name stays the same,&lt;BR /&gt;// but he is assigned another personell_number.&lt;/P&gt;&lt;P&gt;LEFT JOIN (MA_Grunddaten)&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; COUNT(Pers_Nr4) as ID_count&lt;BR /&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp; COUNT(Kennz) as Kennz_count&lt;BR /&gt;RESIDENT MA_Grunddaten&lt;BR /&gt;&amp;nbsp; GROUP BY Name&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Übernahmen_pre:&lt;BR /&gt;LOAD&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Pers_Nr4,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Kennz,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Eintritt&lt;BR /&gt;RESIDENT MA_Grunddaten&lt;BR /&gt; WHERE&amp;nbsp; ID_count &amp;gt; 1&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;// Every employee now has two "join_dates" ("Eintritt"): The date the employee first joined the company&lt;BR /&gt;// AND the date he/she was adopted. I need only the latter.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;LEFT JOIN (Übernahmen_pre)&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATE(max(Eintritt)) as Datum_Übernahme&lt;BR /&gt;Resident Übernahmen_pre&lt;BR /&gt; GROUP BY Name&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;// Next, I want to make sure I grab only employees who have two records with two different type_flags - usually, when&lt;BR /&gt;// a contract worker is adopted, his/her type_flag changes, but there are exceptions.&lt;/P&gt;&lt;P&gt;Übernahmen_pre2:&lt;BR /&gt;LOAD&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COUNT(DISTINCT Kennz) as Kennz_count&lt;BR /&gt;RESIDENT Übernahmen_pre&lt;BR /&gt;&amp;nbsp; GROUP BY Name&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;LEFT JOIN (Übernahmen_pre)&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Kennz_count&lt;BR /&gt;RESIDENT Übernahmen_pre2&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;// Now the actual work is done - only the resulting tables has both records for every employee who was adopted&lt;BR /&gt;// (both with the later date, the date of his/her adoption), so we use the MOD() function to grab only every other record.&lt;/P&gt;&lt;P&gt;DROP TABLE Übernahmen_pre2;&lt;/P&gt;&lt;P&gt;Übernahmen_pre3:&lt;BR /&gt;LOAD&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RecNo() as Row_ID,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Datum_Übernahme&lt;BR /&gt;RESIDENT Übernahmen_pre&lt;BR /&gt;&amp;nbsp; WHERE Kennz_count &amp;gt; 1&lt;BR /&gt;;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;DROP TABLE Übernahmen_pre;&lt;/P&gt;&lt;P&gt;// In dieser Tabelle haben wir im Prinzip schon das richtige, aber wir brauchen nur jeden zweiten Datensatz.&lt;BR /&gt;// Deshalb nehmen wir mithilfe der MOD-Fkt nur die geraden Datensätze raus (jew. den zweiten).&lt;/P&gt;&lt;P&gt;Übernahmen:&lt;BR /&gt;LOAD&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Datum_Übernahme,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Datum_Übernahme as %Datum,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month(Datum_Übernahme) as Übernahmemonat,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year(Datum_Übernahme) as Übernahmejahr&lt;BR /&gt;RESIDENT Übernahmen_pre3&lt;BR /&gt;&amp;nbsp; WHERE Mod(Row_ID, 2)=0&lt;BR /&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jan 2026 18:19:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Personell-data-employees-adopted/m-p/479198#M1269587</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2026-01-26T18:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: Personell data - employees adopted</title>
      <link>https://community.qlik.com/t5/QlikView/Personell-data-employees-adopted/m-p/479199#M1269588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you send the QVW file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Sep 2013 06:03:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Personell-data-employees-adopted/m-p/479199#M1269588</guid>
      <dc:creator>gainkarthi</dc:creator>
      <dc:date>2013-09-06T06:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: Personell data - employees adopted</title>
      <link>https://community.qlik.com/t5/QlikView/Personell-data-employees-adopted/m-p/479200#M1269589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Karthikeyan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;no, I'm sorry - it is an HR Dashboard, and personell_data is extremely sensitive. I don't feel too comfortable dealing with it at all as long as I don't have a written explanation of it all, but I can surely not pass it on. Sorry!&lt;/P&gt;&lt;P&gt;I understand that makes it quite difficult for you to help me. Unfortunately that can't be helped.&lt;/P&gt;&lt;P&gt;All I wanted, actually, was to check the logic of the script. I have already checked it and I cannot find anything weird. We are a bit stuck with this. If the "error" lies with the data, then it's clear that there is something we haven't understood and that we need a consultant - but as that is a bit complicated at the time being, I wanted to be absolutely sure there was no error in my script.&lt;/P&gt;&lt;P&gt;If there is anything unclear in the script and comments as I posted them, let me know and I will do my best to clarify.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Sep 2013 07:12:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Personell-data-employees-adopted/m-p/479200#M1269589</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2013-09-06T07:12:05Z</dc:date>
    </item>
  </channel>
</rss>

