<?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: How to find out names that exist twice? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-find-out-names-that-exist-twice/m-p/543731#M691464</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi Andrew,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;many thanks!&lt;/P&gt;&lt;P&gt;In the meantime, I have myself found out that the max() function works - I get the later date within each pair of records.&lt;/P&gt;&lt;P&gt;Also, i can use the COUNT(DISTINCT ) fct and another RESIDENT LOAD to get only those pairs of records where the type_flag actually changed.&lt;/P&gt;&lt;P&gt;I will now try to link this to my master_calendar before I get to the even more complex matters &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Aug 2013 11:05:56 GMT</pubDate>
    <dc:creator>datanibbler</dc:creator>
    <dc:date>2013-08-29T11:05:56Z</dc:date>
    <item>
      <title>How to find out names that exist twice?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-find-out-names-that-exist-twice/m-p/543725#M691458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please help me - this must be relatively simple to do - I would have known how to do it in the software I worked with in my last job, just not in QlikView.&lt;/P&gt;&lt;P&gt;- I have a masterdata table with all employees.&lt;/P&gt;&lt;P&gt;- Employees who started as contract workers, but were eventually adopted, have two records: They get a different number, only the name stays the same.&lt;/P&gt;&lt;P&gt;- I want to load (RESIDENT, for I have already loaded the masterdata table) only those records where one name has two records - all two of them per pair, if possible, together with one other field that I have to check also.&lt;/P&gt;&lt;P&gt;- I have tried using the PEEK fct. inside a WHERE clause (after sorting) to get only those where the name equals that in the record above, that worked, but it returned 0 records.&lt;/P&gt;&lt;P&gt;- I know I could load aggregated data using a COUNT or COUNT(DISTINCT), but that would not help me, would it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Aug 2013 15:13:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-find-out-names-that-exist-twice/m-p/543725#M691458</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2013-08-28T15:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to find out names that exist twice?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-find-out-names-that-exist-twice/m-p/543726#M691459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;load name,&lt;/P&gt;&lt;P&gt;count(name) as name_Count&lt;/P&gt;&lt;P&gt;resident x&lt;/P&gt;&lt;P&gt;group by name;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you can left join this with x using name&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then you can do a resident load again with a field to flag off records with name_Count &amp;gt;= 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Abey&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Aug 2013 15:21:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-find-out-names-that-exist-twice/m-p/543726#M691459</guid>
      <dc:creator>abeyphilip</dc:creator>
      <dc:date>2013-08-28T15:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to find out names that exist twice?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-find-out-names-that-exist-twice/m-p/543727#M691460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Let's assume that your number field is named numeric_id.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the preceding answer, there is a typo error: you should replace count(name) by:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count(numeric_id) as number_count&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can do it in the dashboard with a pivot table whose first dimension is a calculated one:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aggr(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count( DISTINCT numeric_id )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and the following dimensions are: name , numeric_id.&lt;/P&gt;&lt;P&gt;As expresssions of your pivot table, take&lt;/P&gt;&lt;P&gt;count(DISTINCT name)&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;count( DISTINCT numeric_id)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to obtain the volume of the pairs.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Aug 2013 21:53:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-find-out-names-that-exist-twice/m-p/543727#M691460</guid>
      <dc:creator>rlp</dc:creator>
      <dc:date>2013-08-28T21:53:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to find out names that exist twice?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-find-out-names-that-exist-twice/m-p/543728#M691461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Richard,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for the answer! I don't want to do this in the GUI, but rather in the script - so I will try Abey's solution.&lt;/P&gt;&lt;P&gt;I'm still thinking it through - I have to "pump up" that masterdata table, so that instead of&lt;/P&gt;&lt;P&gt;one record per employee with a start_date and an end_date, I'll have&lt;/P&gt;&lt;P&gt;one record per employee per day inbetween&lt;/P&gt;&lt;P&gt;but I guess that LEFT JOIN would not add a lot of data to that table, so I can still do that as I have it now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will try that and I'll report back here in any case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 06:56:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-find-out-names-that-exist-twice/m-p/543728#M691461</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2013-08-29T06:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to find out names that exist twice?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-find-out-names-that-exist-twice/m-p/543729#M691462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;many thanks, Abey! That worked just as I hoped it would. I am not there yet though &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Now I have a table that has only pairs of records - it's always "one name, two records"&lt;/P&gt;&lt;P&gt;along with two different ID_numbers, two type_flags and two dates. Now I have to do the following:&lt;/P&gt;&lt;P&gt;- I have to make sure those two type_flags in every pair are different - that should always be the case, but I have&amp;nbsp;&amp;nbsp;&amp;nbsp; already seen an exception.&lt;/P&gt;&lt;P&gt;- Of the two different dates (entry_dates) in every pair, I need only the later one (the first one is the date an employee joined the company, the second one is the date he was adopted). I need to link this to my calendar to be able to display the nr. of employees adopted in a certain month, so I can have only one date per name. I have thought of the max() fct, but that would return the latest date of all records, wouldn't it? I'll check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It might get even more complex going forward, but those should be the next steps.&lt;/P&gt;&lt;P&gt;As always, I will get to work straight away and see what I can do myself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 10:36:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-find-out-names-that-exist-twice/m-p/543729#M691462</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2013-08-29T10:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: Re: How to find out names that exist twice?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-find-out-names-that-exist-twice/m-p/543730#M691463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could either use the max function to pull through only the maximum dates grouped by employee name or you could use a calendar link table to link both dates to your master calendar. You can create a calendar link table as follows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CalendarLink:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field 1, (Primary Key from master table)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field 2, (date type 1 from the master table) as Field 3 (date field in your master calendar)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 as DateType (this flag will allow you to refer to the above date type in a set analysis expression&lt;/P&gt;&lt;P&gt;Resident master table;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Concatenate (CalendarLink)&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field 1 (same as above)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field 4 (date type 2 from master table) as Field 3 (link to master calendar)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 as DateType (same as above)&lt;/P&gt;&lt;P&gt;Resident master table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An example expression might be sum({$&amp;lt;DateType = {0}&amp;gt;}[# Number of Employees])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you've done it right, it should look something like the attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 10:54:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-find-out-names-that-exist-twice/m-p/543730#M691463</guid>
      <dc:creator />
      <dc:date>2013-08-29T10:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to find out names that exist twice?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-find-out-names-that-exist-twice/m-p/543731#M691464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi Andrew,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;many thanks!&lt;/P&gt;&lt;P&gt;In the meantime, I have myself found out that the max() function works - I get the later date within each pair of records.&lt;/P&gt;&lt;P&gt;Also, i can use the COUNT(DISTINCT ) fct and another RESIDENT LOAD to get only those pairs of records where the type_flag actually changed.&lt;/P&gt;&lt;P&gt;I will now try to link this to my master_calendar before I get to the even more complex matters &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 11:05:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-find-out-names-that-exist-twice/m-p/543731#M691464</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2013-08-29T11:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to find out names that exist twice?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-find-out-names-that-exist-twice/m-p/543732#M691465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No worries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It really depends on what you want to do. If you ever have data which has lots of different date types then the calendar link table is really useful. You can add as many date types as you like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 11:09:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-find-out-names-that-exist-twice/m-p/543732#M691465</guid>
      <dc:creator />
      <dc:date>2013-08-29T11:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to find out names that exist twice?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-find-out-names-that-exist-twice/m-p/543733#M691466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am assuming you have the following columns in that table:&lt;/P&gt;&lt;P&gt;Name, ID_Number, Type, Etry_Date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So as you pointed max(Entry_Date) with a "group by name" query should work fine. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Temp_Adopt_Load:&lt;/P&gt;&lt;P&gt;noconcatenate load name,&lt;/P&gt;&lt;P&gt;max(Entry_Date) as Adopt_Date&lt;/P&gt;&lt;P&gt;resident x&lt;/P&gt;&lt;P&gt;group by name;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adopt_Load:&lt;/P&gt;&lt;P&gt;noconcatenate load &lt;/P&gt;&lt;P&gt;name,&lt;/P&gt;&lt;P&gt;Adopt_Date&lt;/P&gt;&lt;P&gt;name&amp;amp;Adopt_Date as Name_Date_Key&lt;/P&gt;&lt;P&gt;resident Temp_Adopt_Load;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table Temp_Adopt_Load;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;left join load name&amp;amp;Entry_Date as Name_Date_Key,&lt;/P&gt;&lt;P&gt;ID_Number, &lt;/P&gt;&lt;P&gt;Type&lt;/P&gt;&lt;P&gt;resident x;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Abey&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 11:11:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-find-out-names-that-exist-twice/m-p/543733#M691466</guid>
      <dc:creator>abeyphilip</dc:creator>
      <dc:date>2013-08-29T11:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to find out names that exist twice?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-find-out-names-that-exist-twice/m-p/543734#M691467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Abey, I have now used your method (the one you first proposed, with a LEFT JOIN and a consequent RESIDENT LOAD) twice one after the other, with one or two more RESIDENT LOADs inbetween &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;... and finally I have nearly what I want: A list with 22 records of only those persons who have two entries with two different type_flags, along with the date they changed type_flags (the later one).&lt;/P&gt;&lt;P&gt;&amp;lt;=&amp;gt; Now I again have two records per person even though the other data is all correct.I would like only one.&lt;/P&gt;&lt;P&gt;Well, I guess I will make that, too. Maybe I can use a FIRST parameter or so?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Easy - onye you know &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;FIRST x and FIRSTVALUE() would not do - because I need that stupid GROUP BY - but now I simply add a row_ID and do one more RESIDENT LOAD with only the even or the uneven row_IDs &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 12:11:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-find-out-names-that-exist-twice/m-p/543734#M691467</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2013-08-29T12:11:07Z</dc:date>
    </item>
  </channel>
</rss>

