<?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: Adjusting Overlapping Dates in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Adjusting-Overlapping-Dates/m-p/1572776#M597137</link>
    <description>&lt;P&gt;What is the output you expect to see based on the data you have provided in your inline load?&lt;/P&gt;</description>
    <pubDate>Wed, 24 Apr 2019 13:55:46 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2019-04-24T13:55:46Z</dc:date>
    <item>
      <title>Adjusting Overlapping Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Adjusting-Overlapping-Dates/m-p/1572775#M597136</link>
      <description>&lt;P&gt;Hi there.&lt;/P&gt;&lt;P&gt;I am trying to figure out how to adjust my dates that are overlapping.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Events:
LOAD * INLINE[
ID,Start,End,DaysSupply
1500,2018-01-02,2018-02-01,30
2432,2018-01-31,2018-03-02,30
5322,2018-03-01,2018-05-30,90
5777,2018-05-16,2018-08-14,90
]
Temp_adj_Dates:
LOAD 
      ID
    , DaysSupply
    , If(Start &amp;lt; Previous(End),Date(Previous(End)+1,'yyyy-mm-dd'),Start) as Start
    , If(Start &amp;lt; Previous(End),Date(Previous(End)+1 + DaysSupply, 'yyyy-MM-dd'),End) as End
RESIDENT Event
ORDER BY ID,Start;&lt;/PRE&gt;&lt;P&gt;The above is what I have tried, but it doesnt quite work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;* Let me also add that Start plus DaysSupply = End&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 03:46:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adjusting-Overlapping-Dates/m-p/1572775#M597136</guid>
      <dc:creator>cbushey1</dc:creator>
      <dc:date>2024-11-16T03:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: Adjusting Overlapping Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Adjusting-Overlapping-Dates/m-p/1572776#M597137</link>
      <description>&lt;P&gt;What is the output you expect to see based on the data you have provided in your inline load?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2019 13:55:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adjusting-Overlapping-Dates/m-p/1572776#M597137</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-04-24T13:55:46Z</dc:date>
    </item>
    <item>
      <title>Re: Adjusting Overlapping Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Adjusting-Overlapping-Dates/m-p/1572788#M597138</link>
      <description>&lt;P&gt;I would expect the dates to have shifted.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I would want to see the following:&lt;/P&gt;&lt;P&gt;ID,Start,End&lt;/P&gt;&lt;P&gt;1500,2018-01-02,2018-02-01,30&amp;nbsp;&lt;/P&gt;&lt;P&gt;2432,2018-02-02,2018-03-04,30&lt;/P&gt;&lt;P&gt;5322,2018-03-05,2018-06-03,90&lt;/P&gt;&lt;P&gt;5777,2018-06-04,2018-09-02,90&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2019 14:08:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adjusting-Overlapping-Dates/m-p/1572788#M597138</guid>
      <dc:creator>cbushey1</dc:creator>
      <dc:date>2019-04-24T14:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: Adjusting Overlapping Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Adjusting-Overlapping-Dates/m-p/1572803#M597139</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;&lt;PRE&gt;Events:
LOAD * INLINE [
    ID, Start, End, DaysSupply
    1500, 2018-01-02, 2018-02-01, 30
    2432, 2018-01-31, 2018-03-02, 30
    5322, 2018-03-01, 2018-05-30, 90
    5777, 2018-05-16, 2018-08-14, 90
];

Temp_adj_Dates:
NoConcatenate
LOAD ID,
	 Date(If(RowNo() = 1, Start, If(Start &amp;lt; Peek('End'), Peek('End') + 1, Start))) as Start,
	 Date(If(RowNo() = 1, End, If(Start &amp;lt; Peek('End'), End + Peek('End') + 1 - Start, End))) as End,
	 DaysSupply
Resident Events
Order By ID, Start;

DROP Table Events;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Apr 2019 14:20:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adjusting-Overlapping-Dates/m-p/1572803#M597139</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-04-24T14:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: Adjusting Overlapping Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Adjusting-Overlapping-Dates/m-p/1572826#M597140</link>
      <description>&lt;P&gt;Thank you that got me where I needed to be.&lt;/P&gt;&lt;P&gt;Why did you choose to use Peek instead of Previous? Does Peek look at the new calculated value, where previous looks at the pre-calculated value?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2019 14:41:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adjusting-Overlapping-Dates/m-p/1572826#M597140</guid>
      <dc:creator>cbushey1</dc:creator>
      <dc:date>2019-04-24T14:41:42Z</dc:date>
    </item>
    <item>
      <title>Re: Adjusting Overlapping Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Adjusting-Overlapping-Dates/m-p/1572840#M597141</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/45207"&gt;@cbushey1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Why did you choose to use Peek instead of Previous? Does Peek look at the new calculated value, where previous looks at the pre-calculated value?&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Yup &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2019 14:55:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adjusting-Overlapping-Dates/m-p/1572840#M597141</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-04-24T14:55:24Z</dc:date>
    </item>
  </channel>
</rss>

