<?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: Problem with personell_data in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-with-personell-data/m-p/617623#M681666</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would try to solve it within the script in a table with sorting for emp and date and look and check the previous record, roughly so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;t1:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; emp,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(emp = peek('emp) and ...., then, else) as Flag&lt;/P&gt;&lt;P&gt;Resident xyz order by emp, date;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps you need more then one field to calculate if there are breaks within the illness or something else, for example a cumulative of the absence days. Maybe it could be helpful to create firstly a master-calendar-table and join/map your data there for cases you need complete date-areas and weekends or holidays are missing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Mar 2014 14:24:00 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2014-03-10T14:24:00Z</dc:date>
    <item>
      <title>Problem with personell_data</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-personell-data/m-p/617622#M681665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am facing a new challenge, to display a new KPI in personell_data - that is the problematic thing about it, for it means I can hardly share any of the data online - personell_data is very, well, problematic ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The scenario I have to solve (on scripting level) is this:&lt;/P&gt;&lt;P&gt;- Every emp has an emp_nr., of course.&lt;/P&gt;&lt;P&gt;- If any emp reports sick on a day (for just that day or for n days), that is in the database.&lt;/P&gt;&lt;P&gt;- Currently, I extract that information, but only&lt;BR /&gt;&amp;nbsp; =&amp;gt; to display, on a daily basis, the nr. of emps (a COUNT DISTINCT of emp_nrs) that I have "sick_flags" for.&lt;/P&gt;&lt;P&gt;- The thing is, amont the nr. of emps who are sick on a given day, there may of course be some&lt;BR /&gt;&amp;nbsp; who have already been sick for n days in a row.&lt;/P&gt;&lt;P&gt;=&amp;gt; That's what I want to get out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- When I run this script, what I currently get is the emp_nr. and, if I select one, all the days I have in that database_table, that is, all the days when this specific emp was reported sick or absent.&lt;/P&gt;&lt;P&gt;=&amp;gt; I could now just sum up all those days (there is a static field with a nr 1 in the table), but&lt;BR /&gt;&amp;lt;=&amp;gt; I want only the nr. of days this emp was sick in a row, that is, with no break longer than 2d (weekend) inbetween&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (the emp could have been sick for 6d, then he was here again and then sick for 3d at another time)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&amp;gt; How can I do that in the script?&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>Mon, 10 Mar 2014 09:30:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-personell-data/m-p/617622#M681665</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2014-03-10T09:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with personell_data</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-personell-data/m-p/617623#M681666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would try to solve it within the script in a table with sorting for emp and date and look and check the previous record, roughly so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;t1:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; emp,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(emp = peek('emp) and ...., then, else) as Flag&lt;/P&gt;&lt;P&gt;Resident xyz order by emp, date;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps you need more then one field to calculate if there are breaks within the illness or something else, for example a cumulative of the absence days. Maybe it could be helpful to create firstly a master-calendar-table and join/map your data there for cases you need complete date-areas and weekends or holidays are missing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Mar 2014 14:24:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-personell-data/m-p/617623#M681666</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2014-03-10T14:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with personell_data</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-personell-data/m-p/617624#M681667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for helping!&lt;/P&gt;&lt;P&gt;This will have to wait for a day or two, I have sth. more pressing to prepare.&lt;/P&gt;&lt;P&gt;However, what I have done so far is roughly along the lines of your post:&lt;/P&gt;&lt;P&gt;- I have defined one "illness" as a group of days with sick_flags with no break longer than 2d (weekend)&lt;/P&gt;&lt;P&gt;- Within one such "illness", I now have a counter_field going from 1 to whatever is the total duration.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&amp;gt; The next step now is, within one "illness", every record should have the total duration (the value that counter has&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; in the last record of that "group").=&amp;gt; If I could do that with the PEEK() fct., that would be easier&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;=&amp;gt; If not, I would have to think of aggregating it into a temp_table and then joining that to the primary table.&lt;/P&gt;&lt;P&gt;&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>Mon, 10 Mar 2014 14:59:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-personell-data/m-p/617624#M681667</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2014-03-10T14:59:45Z</dc:date>
    </item>
  </channel>
</rss>

