<?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 Add yearly value per dimension field in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Add-yearly-value-per-dimension-field-in-script/m-p/1686102#M594101</link>
    <description>&lt;P&gt;Dear Qlik fans,&lt;/P&gt;&lt;P&gt;I want to add the number of days off to all employees for each year, but I'm not succeeding in this task.&lt;/P&gt;&lt;P&gt;In the inline script you find the number of days off per employee. After each fifth year after the start of a contract the employee is rewarded with an additional day off. When allis realized in the script, I can calculate the cumulative number of days off from 2018 front end (Sum({$&amp;lt;Year={'&amp;gt;=2018'}&amp;gt;}TotalAnnualDaysOff).&lt;/P&gt;&lt;P&gt;As you can see in the qvw I'm able to add the number of days off when there is a year without a new contract. However, the arrival of new employee shouldn't mean that the employees who already had a contract don't get days off anymore; there shouldn't be any replacements, the annual days off for every employee individually just needs to continue.&lt;/P&gt;&lt;P&gt;I am confident that we don't need to copy the already existing script for each employee and then concatenate all into one table. I don't think the existing code is the quickest way to achieve the goal either, so feel free to adjust it.&lt;/P&gt;&lt;P&gt;Many thanks in advance!&lt;/P&gt;&lt;P&gt;Pim&lt;/P&gt;</description>
    <pubDate>Thu, 19 Mar 2020 13:01:06 GMT</pubDate>
    <dc:creator>pvanderkolk</dc:creator>
    <dc:date>2020-03-19T13:01:06Z</dc:date>
    <item>
      <title>Add yearly value per dimension field in script</title>
      <link>https://community.qlik.com/t5/QlikView/Add-yearly-value-per-dimension-field-in-script/m-p/1686102#M594101</link>
      <description>&lt;P&gt;Dear Qlik fans,&lt;/P&gt;&lt;P&gt;I want to add the number of days off to all employees for each year, but I'm not succeeding in this task.&lt;/P&gt;&lt;P&gt;In the inline script you find the number of days off per employee. After each fifth year after the start of a contract the employee is rewarded with an additional day off. When allis realized in the script, I can calculate the cumulative number of days off from 2018 front end (Sum({$&amp;lt;Year={'&amp;gt;=2018'}&amp;gt;}TotalAnnualDaysOff).&lt;/P&gt;&lt;P&gt;As you can see in the qvw I'm able to add the number of days off when there is a year without a new contract. However, the arrival of new employee shouldn't mean that the employees who already had a contract don't get days off anymore; there shouldn't be any replacements, the annual days off for every employee individually just needs to continue.&lt;/P&gt;&lt;P&gt;I am confident that we don't need to copy the already existing script for each employee and then concatenate all into one table. I don't think the existing code is the quickest way to achieve the goal either, so feel free to adjust it.&lt;/P&gt;&lt;P&gt;Many thanks in advance!&lt;/P&gt;&lt;P&gt;Pim&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2020 13:01:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-yearly-value-per-dimension-field-in-script/m-p/1686102#M594101</guid>
      <dc:creator>pvanderkolk</dc:creator>
      <dc:date>2020-03-19T13:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: Add yearly value per dimension field in script</title>
      <link>https://community.qlik.com/t5/QlikView/Add-yearly-value-per-dimension-field-in-script/m-p/1686134#M594102</link>
      <description>&lt;P&gt;Do you may be need this?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Sample:
LOAD *,
	 Year(Contract) as YearOfContract,
	 Year(Contract) + IterNo() - 1 as ContractStart,
	 AnnualDaysOff + Floor((IterNo()-1)/5) as TotalAnnualDaysOff
While Year(Contract) + IterNo() - 1 &amp;lt;= Year(Today(1));
LOAD * INLINE [
    RelGid, Contract, AnnualDaysOff
    903, 01-05-1996, 14
    1623, 01-10-1995, 10
    2460, 01-07-2014, 14
    2554, 01-10-2014, 14
    2760, 19-02-2017, 14
];&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 19 Mar 2020 13:49:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-yearly-value-per-dimension-field-in-script/m-p/1686134#M594102</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2020-03-19T13:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: Add yearly value per dimension field in script</title>
      <link>https://community.qlik.com/t5/QlikView/Add-yearly-value-per-dimension-field-in-script/m-p/1686416#M594103</link>
      <description>&lt;P&gt;Thanks a lot Sunny, that is exactly what I needed! I was afraid that Iterno() would increase the reload time heavily in the actual dashboard, but that's not the issue.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2020 09:45:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-yearly-value-per-dimension-field-in-script/m-p/1686416#M594103</guid>
      <dc:creator>pvanderkolk</dc:creator>
      <dc:date>2020-03-20T09:45:55Z</dc:date>
    </item>
  </channel>
</rss>

