<?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 Join creates unnecessary duplication in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Join-creates-unnecessary-duplication/m-p/159151#M33915</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the need to create a table where for each customer there is a row for every day they played along with the date of their previous play.&lt;BR /&gt;So the table will look like:&lt;BR /&gt;Id, Date1, Date2&lt;/P&gt;&lt;P&gt;The purpose of this is to define on each play whether the customer is new, reactivated, lapsed or existing based on business definitions on the interval between date1 and date2.&lt;/P&gt;&lt;P&gt;I've tried several methods for this, one being creating a single QVD with fields CustomerId, rownumber, rownumber2 (which is rownumber+1), date. I also tried a version where CustomerId and rownumber are contatenated (in the SQL query) to make crmid (and crmid2) which would be [Customerid]-[rownumber] (i.e. 1234-1, 1234-2, etc).&lt;/P&gt;&lt;P&gt;What I have tried to do is join as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;I&gt;&lt;/I&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&l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&lt;/B&gt; &lt;B&gt;&lt;I&gt;$(vQVDPath)&lt;/I&gt;&lt;/B&gt;MeccaCRM.qvd (qvd);&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;This logic works fine in SQL Server and I get a table unique on crmid with date1 and date2, but in QlikView it produces random duplication and I can't work out why. I have tried using two separate QVDs, loading distinct, NOCONCATENATE functions but I always end up with duplicates, specifically when the the rownumber is less than 10.&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Jan 2011 10:45:50 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-01-07T10:45:50Z</dc:date>
    <item>
      <title>Join creates unnecessary duplication</title>
      <link>https://community.qlik.com/t5/QlikView/Join-creates-unnecessary-duplication/m-p/159151#M33915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the need to create a table where for each customer there is a row for every day they played along with the date of their previous play.&lt;BR /&gt;So the table will look like:&lt;BR /&gt;Id, Date1, Date2&lt;/P&gt;&lt;P&gt;The purpose of this is to define on each play whether the customer is new, reactivated, lapsed or existing based on business definitions on the interval between date1 and date2.&lt;/P&gt;&lt;P&gt;I've tried several methods for this, one being creating a single QVD with fields CustomerId, rownumber, rownumber2 (which is rownumber+1), date. I also tried a version where CustomerId and rownumber are contatenated (in the SQL query) to make crmid (and crmid2) which would be [Customerid]-[rownumber] (i.e. 1234-1, 1234-2, etc).&lt;/P&gt;&lt;P&gt;What I have tried to do is join as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt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Path)&lt;/I&gt;&lt;/B&gt;MeccaCRM.qvd (qvd);&lt;BR /&gt;&lt;B&gt;LEFT&lt;/B&gt; &lt;B&gt;JOIN&lt;BR /&gt;LOAD&lt;/B&gt; crmid2 &lt;B&gt;as&lt;/B&gt; crmid, date &lt;B&gt;as&lt;/B&gt; date2&lt;BR /&gt;&lt;B&gt;FROM&lt;/B&gt; &lt;B&gt;&lt;I&gt;$(vQVDPath)&lt;/I&gt;&lt;/B&gt;MeccaCRM.qvd (qvd);&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;This logic works fine in SQL Server and I get a table unique on crmid with date1 and date2, but in QlikView it produces random duplication and I can't work out why. I have tried using two separate QVDs, loading distinct, NOCONCATENATE functions but I always end up with duplicates, specifically when the the rownumber is less than 10.&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jan 2011 10:45:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-creates-unnecessary-duplication/m-p/159151#M33915</guid>
      <dc:creator />
      <dc:date>2011-01-07T10:45:50Z</dc:date>
    </item>
  </channel>
</rss>

