<?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 Checking for Duplicates in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Checking-for-Duplicates/m-p/1090351#M362768</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good Day &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just want to verify whether this &lt;STRONG&gt;if statement&lt;/STRONG&gt; will return the correct results I have a set of data for all vehicles and some ref numbers and customer names appear more than once, so I want to distinguish between repurchases (customers who have bought vehicles before) and first time buyers so I wrote this if statement in my script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If((Contract_Ref_no) and (Customer_name)&amp;gt;1,'Repurchases','First Time Buyers') AS [Repurchases]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the reason I am skeptical is that there are more repurchases than first time buyers so I was wondering whether it might be the code for some reason.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Mar 2016 12:55:00 GMT</pubDate>
    <dc:creator>kaygee28</dc:creator>
    <dc:date>2016-03-29T12:55:00Z</dc:date>
    <item>
      <title>Checking for Duplicates</title>
      <link>https://community.qlik.com/t5/QlikView/Checking-for-Duplicates/m-p/1090351#M362768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good Day &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just want to verify whether this &lt;STRONG&gt;if statement&lt;/STRONG&gt; will return the correct results I have a set of data for all vehicles and some ref numbers and customer names appear more than once, so I want to distinguish between repurchases (customers who have bought vehicles before) and first time buyers so I wrote this if statement in my script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If((Contract_Ref_no) and (Customer_name)&amp;gt;1,'Repurchases','First Time Buyers') AS [Repurchases]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the reason I am skeptical is that there are more repurchases than first time buyers so I was wondering whether it might be the code for some reason.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Mar 2016 12:55:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Checking-for-Duplicates/m-p/1090351#M362768</guid>
      <dc:creator>kaygee28</dc:creator>
      <dc:date>2016-03-29T12:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: Checking for Duplicates</title>
      <link>https://community.qlik.com/t5/QlikView/Checking-for-Duplicates/m-p/1090352#M362769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;If((Contract_Ref_no) and (Customer_name)&amp;gt;1,'Repurchases','First Time Buyers') AS [Repurchases]&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I don't understand what you're trying to test. What is &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;EM&gt;(Contract_Ref_no) and (Customer_name)&amp;gt;1&lt;/EM&gt; supposed to do? Contract_Ref_no is probably a number, so likely to be larger than 1, but are your Customer_name values numbers too?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2016 10:32:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Checking-for-Duplicates/m-p/1090352#M362769</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-03-30T10:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: Checking for Duplicates</title>
      <link>https://community.qlik.com/t5/QlikView/Checking-for-Duplicates/m-p/1090353#M362770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Seems to me that you want to aggregate record values ("Count duplicates"), so you would need a GROUP BY clause in your script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LEFT JOIN (YourTable)&lt;/P&gt;&lt;P&gt;LOAD [Contract_Ref_No],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Customer_name],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If( Count(&lt;SPAN style="font-size: 13.3333px;"&gt;[Customer_name]&lt;/SPAN&gt;) &amp;gt;1, 'Repurchases', 'First Time Buyers') as [Repurchases]&lt;/P&gt;&lt;P&gt;RESIDENT YourTable&lt;/P&gt;&lt;P&gt;GROUP BY [Contract_Ref_No], [Customer_name];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe it's sufficient to only use [Contract_Ref_No] in above load instead of the two fields. And it may be better to check on something like OrderNo or OrderDate instead of name:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;LEFT JOIN (YourTable)&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;LOAD [Contract_Ref_No],&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If( Count(DISTINCT OrderNo) &amp;gt;1, 'Repurchases', 'First Time Buyers') as [Repurchases]&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;RESIDENT YourTable&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;GROUP BY [Contract_Ref_No];&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;To make this work, all fields need to be part of YourTable, not of several distinct tables in your data model.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Hope this helps,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2016 10:48:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Checking-for-Duplicates/m-p/1090353#M362770</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-03-30T10:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: Checking for Duplicates</title>
      <link>https://community.qlik.com/t5/QlikView/Checking-for-Duplicates/m-p/1090354#M362771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A _jive_internal="true" data-avatarid="6257" data-externalid="" data-online="false" data-presence="null" data-userid="96544" data-username="gwassenaar" href="https://community.qlik.com/people/gwassenaar" style="font-weight: bold; font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #8b8b8b; background-color: #f2f2f2;"&gt;Gysbert Wassenaar&lt;/A&gt;&lt;SPAN style="color: #a9a9a9; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f2f2f2;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Contract_Ref_no is a unique Id each customer is given when they open an account and the customer_name is a string dependent on the name of the customer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All i wanted to do is to check for duplicates if there is a contract_ref_no and a customer name that appears more than once then it will be regarded as a repurchase.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2016 13:02:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Checking-for-Duplicates/m-p/1090354#M362771</guid>
      <dc:creator>kaygee28</dc:creator>
      <dc:date>2016-03-30T13:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: Checking for Duplicates</title>
      <link>https://community.qlik.com/t5/QlikView/Checking-for-Duplicates/m-p/1090355#M362772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Swuel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it worked it looks more or less correct now first time buyer stats are 97% and Repurchases are at 3%, I would rather remain safe and keep the Contr_Ref_no as well as the Customer name as the key identifiers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2016 13:30:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Checking-for-Duplicates/m-p/1090355#M362772</guid>
      <dc:creator>kaygee28</dc:creator>
      <dc:date>2016-03-30T13:30:26Z</dc:date>
    </item>
  </channel>
</rss>

