<?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: SQL: Group data when a value will be repeated for a ID and create a gapless date range in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/SQL-Group-data-when-a-value-will-be-repeated-for-a-ID-and-create/m-p/1119509#M369155</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Rakesh for your help. In the meanwhile I could solve the problem by using the following sql statement that I received by a Stack Overflow user.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://stackoverflow.com/a/38268666" title="http://stackoverflow.com/a/38268666"&gt;qlikview - Collapse Data in Sql without stored precedure or function if a value is the same as the value from row above …&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 Jul 2016 04:59:59 GMT</pubDate>
    <dc:creator>daniel1990xyz</dc:creator>
    <dc:date>2016-07-15T04:59:59Z</dc:date>
    <item>
      <title>SQL: Group data when a value will be repeated for a ID and create a gapless date range</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-Group-data-when-a-value-will-be-repeated-for-a-ID-and-create/m-p/1119507#M369153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to group data from a sql table as long as the value "TreatDataTableInfo" will not change. And I would link to use the &lt;SPAN style="color: #ff0000;"&gt;oldest date&lt;/SPAN&gt; from the group as the "FromDate" and the &lt;SPAN style="color: #339966;"&gt;date from the next group/next data record with different "TreatDataTableInfo" -1day&lt;/SPAN&gt;&amp;nbsp; as the "ToDate". So in the end the groups should have a gap in the date range. Please check the screenshot for a example. I have highlighted two grouping examples.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="TreatDataTableIssue.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/130699_TreatDataTableIssue.JPG" style="height: 389px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;I have tried to solve this problem by using sql (group by) and by using QlikView Load statements with peek() and so, but I can not find a solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for any advice/help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2016 13:32:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-Group-data-when-a-value-will-be-repeated-for-a-ID-and-create/m-p/1119507#M369153</guid>
      <dc:creator>daniel1990xyz</dc:creator>
      <dc:date>2016-07-08T13:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: SQL: Group data when a value will be repeated for a ID and create a gapless date range</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-Group-data-when-a-value-will-be-repeated-for-a-ID-and-create/m-p/1119508#M369154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can the grouping in LOAD statement.&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;LOAD Part_ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; min(Date) as From_Date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TreatDateTableInfo,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TreatID&lt;/P&gt;&lt;P&gt;from &amp;lt;sourcefile&amp;gt;&lt;/P&gt;&lt;P&gt;GROUP by Part_ID, &lt;SPAN style="font-size: 13.3333px;"&gt;TreatDateTableInfo, &lt;SPAN style="font-size: 13.3333px;"&gt;TreatID&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;ORDER BY Date&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;left join(Table1)&lt;/P&gt;&lt;P&gt;LOAD date(date#(From_Date)-1) as To_Date,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;TreatDateTableInfo,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TreatID,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;previous(From_Date) as From_Date&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;resident Table1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2016 14:10:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-Group-data-when-a-value-will-be-repeated-for-a-ID-and-create/m-p/1119508#M369154</guid>
      <dc:creator>boorgura</dc:creator>
      <dc:date>2016-07-08T14:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: SQL: Group data when a value will be repeated for a ID and create a gapless date range</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-Group-data-when-a-value-will-be-repeated-for-a-ID-and-create/m-p/1119509#M369155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Rakesh for your help. In the meanwhile I could solve the problem by using the following sql statement that I received by a Stack Overflow user.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://stackoverflow.com/a/38268666" title="http://stackoverflow.com/a/38268666"&gt;qlikview - Collapse Data in Sql without stored precedure or function if a value is the same as the value from row above …&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jul 2016 04:59:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-Group-data-when-a-value-will-be-repeated-for-a-ID-and-create/m-p/1119509#M369155</guid>
      <dc:creator>daniel1990xyz</dc:creator>
      <dc:date>2016-07-15T04:59:59Z</dc:date>
    </item>
  </channel>
</rss>

