<?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: Remove duplicate rows based on 3 column names in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/Remove-duplicate-rows-based-on-3-column-names/m-p/63220#M16195</link>
    <description>&lt;P&gt;Hi Mukesh&lt;/P&gt;
&lt;P&gt;Thanks for your solution&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tested but their is thing that it is checking for consecutive rows I guess what if their is one row at index like 1 and same is repeated at row index 10&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have implemented and tested it but it is not able to remove duplicate rows which are not in consecutive positions&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Can you please check if I am doing any wrong&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Lakshmi Narayana&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
    <pubDate>Sat, 18 Mar 2023 04:17:00 GMT</pubDate>
    <dc:creator>plnarayana777</dc:creator>
    <dc:date>2023-03-18T04:17:00Z</dc:date>
    <item>
      <title>Remove duplicate rows based on 3 column names</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Remove-duplicate-rows-based-on-3-column-names/m-p/63216#M16191</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;Can anyone help me on custom code to remove duplicate rows from a collection based on 3 column names. The input collection has 6 columns in total. i wanted to remove duplicates based on 3 columns.&lt;/P&gt;
&lt;P&gt;Thanks in Advance&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Amrutha Sivarajan&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Fri, 17 Mar 2023 01:46:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Remove-duplicate-rows-based-on-3-column-names/m-p/63216#M16191</guid>
      <dc:creator>Amruthasimplify</dc:creator>
      <dc:date>2023-03-17T01:46:00Z</dc:date>
    </item>
    <item>
      <title>RE: Remove duplicate rows based on 3 column names</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Remove-duplicate-rows-based-on-3-column-names/m-p/63217#M16192</link>
      <description>&lt;P&gt;Hi Amrutha&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Can you try the below code&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dim dt As DataTable = [your DataTable]&lt;BR /&gt;Dim columnNames() As String = inputColumnName.Split(","c) 'replace with your input parameter that contains the column names&lt;BR /&gt;Dim distinctDT As DataTable = dt.DefaultView.ToTable(True, columnNames)&lt;/P&gt;
&lt;P&gt;above code from chat gpt and also refer below thread for better understanding&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.blueprism.com/communities/community-home/digestviewer/viewthread?MessageKey=99472cf6-1d84-4d4b-9fc7-12186ba65599&amp;amp;CommunityKey=3743dbaa-6766-4a4d-b7ed-9a98b6b1dd01#bm99472cf6-1d84-4d4b-9fc7-12186ba65599" target="_blank" rel="noopener"&gt;Delete Repetitive Values in a collection or Excel | Blue Prism Product&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Hope this helps&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Lakshmi Narayana&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Lakshmi Narayana&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Fri, 17 Mar 2023 05:00:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Remove-duplicate-rows-based-on-3-column-names/m-p/63217#M16192</guid>
      <dc:creator>plnarayana777</dc:creator>
      <dc:date>2023-03-17T05:00:00Z</dc:date>
    </item>
    <item>
      <title>RE: Remove duplicate rows based on 3 column names</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Remove-duplicate-rows-based-on-3-column-names/m-p/63218#M16193</link>
      <description>&lt;P&gt;Hi &lt;SPAN&gt;Amrutha,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Avoidance of duplicates can be achieved in two ways:&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;Removing already existing duplicate values&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Avoiding getting in duplicate values&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN&gt;While Lakshmi describes how to tackle the first method, you may also consider to have a look at the second&amp;nbsp;method.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If your collection data was derived from an XL, you might consider extracting the data using OLEDB using an SQL DISTINCT statement that, if constructed correctly, will only populate the collection with unique data.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you data comes from other sources, you might consider checking if a row to be added to the collection perhaps already exists there. And then not adding it if it appears to be a duplicate.&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Happy coding!&lt;BR /&gt;---------------&lt;BR /&gt;Paul&lt;BR /&gt;Sweden&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Fri, 17 Mar 2023 10:13:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Remove-duplicate-rows-based-on-3-column-names/m-p/63218#M16193</guid>
      <dc:creator>PvD_SE</dc:creator>
      <dc:date>2023-03-17T10:13:00Z</dc:date>
    </item>
    <item>
      <title>RE: Remove duplicate rows based on 3 column names</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Remove-duplicate-rows-based-on-3-column-names/m-p/63219#M16194</link>
      <description>&lt;P&gt;Hello &lt;A id="MainCopy_ctl11_ucMessageList_rptMessageList_ProfileImageDisplay_0_NameLink_0" biobubblekey="c3dc92f6-1f5e-42e9-bc81-9224c9d0c7a6" href="https://community.blueprism.com/network/profile?UserKey=c3dc92f6-1f5e-42e9-bc81-9224c9d0c7a6" target="_blank" rel="noopener"&gt;Amrutha Sivarajan&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;You can add an action in one of your extended objects for collection manipulations, make sure you have correct external references for Dll and their Namespaces listed in Initialise stage, please follow below approach:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Add an action in existing collection manipulation extended objects or create a new object if not already.&lt;span class="lia-inline-image-display-wrapper" image-alt="13875.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/14040iABFE7223C9F3A3D5/image-size/large?v=v2&amp;amp;px=999" role="button" title="13875.png" alt="13875.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="13876.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/14039iAB7467556CCD00F0/image-size/large?v=v2&amp;amp;px=999" role="button" title="13876.png" alt="13876.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="13877.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/14038i1E3F03DFA7DF4DDD/image-size/large?v=v2&amp;amp;px=999" role="button" title="13877.png" alt="13877.png" /&gt;&lt;/span&gt;&lt;/LI&gt;
&lt;LI&gt;Write Code as below to act on 3 column based duplicate removal in collections:
&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;STRONG&gt;System.GC.Collect()&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;STRONG&gt;'filteredCollection=RawData.clone()&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;STRONG&gt;'filteredCollection=RawData.DefaultView.ToTable(true, columnToCheck)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;STRONG&gt;dim count as integer=rawData.rows.count-1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;STRONG&gt;dim i as integer =0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;STRONG&gt;dim rowIndex as integer&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;STRONG&gt;for &amp;nbsp;rowIndex = rawData.rows.count-2 to 0 step rowIndex-1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; if rawData.rows(rowIndex).item(columnToCheck1)=rawData.rows(rowIndex+1).item(columnToCheck1) and&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rawData.rows(rowIndex).item(columnToCheck2)=rawData.rows(rowIndex+1).item(columnToCheck2) and&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rawData.rows(rowIndex).item(columnToCheck3)=rawData.rows(rowIndex+1).item(columnToCheck3)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rawData.rows(rowIndex+1).delete&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; end if&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;STRONG&gt;next&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;STRONG&gt;filteredCollection=rawData.copy()&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="13878.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/14042i60DCD465962DD83E/image-size/large?v=v2&amp;amp;px=999" role="button" title="13878.png" alt="13878.png" /&gt;&lt;/span&gt;&lt;/LI&gt;
&lt;LI&gt;Check required Dll and Namespaces -if you find any errors (Snippet below)&lt;span class="lia-inline-image-display-wrapper" image-alt="13879.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/14041iC489694A706AD4E4/image-size/large?v=v2&amp;amp;px=999" role="button" title="13879.png" alt="13879.png" /&gt;&lt;/span&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Let me know if you find any difficulties implementing this.&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Kindly up vote this as "Best Answer" if it adds value or resolves your query in anyway possible, happy to help.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Mukesh Kumar - Senior Automation Developer&lt;BR /&gt;&lt;BR /&gt;NHS England, United Kingdom, GB&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Fri, 17 Mar 2023 10:23:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Remove-duplicate-rows-based-on-3-column-names/m-p/63219#M16194</guid>
      <dc:creator>Mukeshh_k</dc:creator>
      <dc:date>2023-03-17T10:23:00Z</dc:date>
    </item>
    <item>
      <title>RE: Remove duplicate rows based on 3 column names</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Remove-duplicate-rows-based-on-3-column-names/m-p/63220#M16195</link>
      <description>&lt;P&gt;Hi Mukesh&lt;/P&gt;
&lt;P&gt;Thanks for your solution&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tested but their is thing that it is checking for consecutive rows I guess what if their is one row at index like 1 and same is repeated at row index 10&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have implemented and tested it but it is not able to remove duplicate rows which are not in consecutive positions&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Can you please check if I am doing any wrong&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Lakshmi Narayana&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Sat, 18 Mar 2023 04:17:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Remove-duplicate-rows-based-on-3-column-names/m-p/63220#M16195</guid>
      <dc:creator>plnarayana777</dc:creator>
      <dc:date>2023-03-18T04:17:00Z</dc:date>
    </item>
    <item>
      <title>RE: Remove duplicate rows based on 3 column names</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Remove-duplicate-rows-based-on-3-column-names/m-p/63221#M16196</link>
      <description>&lt;P&gt;Hi Mukesh&lt;/P&gt;
&lt;P&gt;Got the answer from your reply in other thread as first need to sort the collection with any one of the column in the three columns&lt;/P&gt;
&lt;P&gt;Please ignore the above&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Lakshmi Narayana&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Sat, 18 Mar 2023 04:33:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Remove-duplicate-rows-based-on-3-column-names/m-p/63221#M16196</guid>
      <dc:creator>plnarayana777</dc:creator>
      <dc:date>2023-03-18T04:33:00Z</dc:date>
    </item>
    <item>
      <title>RE: Remove duplicate rows based on 3 column names</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Remove-duplicate-rows-based-on-3-column-names/m-p/63222#M16197</link>
      <description>&lt;P&gt;Glad you were able to sort that out &amp;nbsp;! There was a similar query but for one column value duplicate - Row removal.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The only thing that changes in the code is the AND condition operator for column/columns to check.&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Kindly up vote this as "Best Answer" if it adds value or resolves your query in anyway possible, happy to help.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Mukesh Kumar - Senior Automation Developer&lt;BR /&gt;&lt;BR /&gt;NHS England, United Kingdom, GB&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Sat, 18 Mar 2023 06:43:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Remove-duplicate-rows-based-on-3-column-names/m-p/63222#M16197</guid>
      <dc:creator>Mukeshh_k</dc:creator>
      <dc:date>2023-03-18T06:43:00Z</dc:date>
    </item>
  </channel>
</rss>

