<?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 Create End Date based on start date in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Create-End-Date-based-on-start-date/m-p/1731126#M452287</link>
    <description>&lt;P&gt;Hello community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is it possible to create in the script an "End Date" which is based on the "start date"?&lt;/P&gt;&lt;P&gt;Currently i get data from SAP where the start date of a price of an article is given but the end date is not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See the table below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;Article No&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;Start Date&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;End Date&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;Price&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;1001&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;01.01.2020&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%" height="27px"&gt;1001&lt;/TD&gt;&lt;TD width="25%" height="27px"&gt;01.02.2020&lt;/TD&gt;&lt;TD width="25%" height="27px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="25%" height="27px"&gt;90&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="25px"&gt;1001&lt;/TD&gt;&lt;TD height="25px"&gt;01.03.2020&lt;/TD&gt;&lt;TD height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD height="25px"&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a possibilty to calculate the End-Date based on the Start date by calculating&lt;/P&gt;&lt;P&gt;if there s a previous Start Date then calculate the current data record of the start date -1 , else set End-Date = 31.12.2999&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See example:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;Article No&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;Start Date&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;End Date&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;Price&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;1001&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;01.01.2020&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;31.01.2020&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;1001&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;01.02.2020&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;29.02.2020&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;90&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;1001&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;01.03.2020&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;31.12.2999&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope anyone can help me here.&lt;/P&gt;&lt;P&gt;BR Le&lt;/P&gt;</description>
    <pubDate>Mon, 27 Jul 2020 16:42:53 GMT</pubDate>
    <dc:creator>thanhphongle</dc:creator>
    <dc:date>2020-07-27T16:42:53Z</dc:date>
    <item>
      <title>Create End Date based on start date</title>
      <link>https://community.qlik.com/t5/QlikView/Create-End-Date-based-on-start-date/m-p/1731126#M452287</link>
      <description>&lt;P&gt;Hello community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is it possible to create in the script an "End Date" which is based on the "start date"?&lt;/P&gt;&lt;P&gt;Currently i get data from SAP where the start date of a price of an article is given but the end date is not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See the table below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;Article No&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;Start Date&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;End Date&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;Price&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;1001&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;01.01.2020&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%" height="27px"&gt;1001&lt;/TD&gt;&lt;TD width="25%" height="27px"&gt;01.02.2020&lt;/TD&gt;&lt;TD width="25%" height="27px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="25%" height="27px"&gt;90&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="25px"&gt;1001&lt;/TD&gt;&lt;TD height="25px"&gt;01.03.2020&lt;/TD&gt;&lt;TD height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD height="25px"&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a possibilty to calculate the End-Date based on the Start date by calculating&lt;/P&gt;&lt;P&gt;if there s a previous Start Date then calculate the current data record of the start date -1 , else set End-Date = 31.12.2999&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See example:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;Article No&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;Start Date&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;End Date&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;Price&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;1001&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;01.01.2020&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;31.01.2020&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;1001&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;01.02.2020&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;29.02.2020&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;90&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;1001&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;01.03.2020&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;31.12.2999&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope anyone can help me here.&lt;/P&gt;&lt;P&gt;BR Le&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 16:42:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-End-Date-based-on-start-date/m-p/1731126#M452287</guid>
      <dc:creator>thanhphongle</dc:creator>
      <dc:date>2020-07-27T16:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: Create End Date based on start date</title>
      <link>https://community.qlik.com/t5/QlikView/Create-End-Date-based-on-start-date/m-p/1731323#M452303</link>
      <description>&lt;P&gt;Maye be :&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Data:
LOAD [Article No], Date#([Start Date],'DD.MM.YYYY') as [Start Date], [End Date] , Price INLINE [
    Article No, Start Date, End Date, Price
    1001,01.01.2020,,100
    1001,01.02.2020,,90
    1001,01.03.2020,,100
];

output:
noconcatenate
load [Article No],[Start Date],if(rowno()=1,Date#('31.12.2999','DD.MM.YYYY'),Date(previous([Start Date]-1),'DD.MM.YYYY')) as [End Date] ,Price;
load * resident Data order by [Start Date] DESC;

drop table Data;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;output:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 597px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/38171i89164F39D364F16C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2020 10:38:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-End-Date-based-on-start-date/m-p/1731323#M452303</guid>
      <dc:creator>Taoufiq_Zarra</dc:creator>
      <dc:date>2020-07-28T10:38:21Z</dc:date>
    </item>
  </channel>
</rss>

