Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

Removing duplicate line items from tablefile object - Plant simulation

Hello Friends,

 

I need your help on removing duplication of same part nos (type:string) . I have around 5000 parts out of which there are many duplicate parts (child parts which are used in multiple Main parts, eg: fasteners).

 

Also need to calculate total qty before removing the duplicates so that I can use the totat qty no in source for MU generation.

 

 

It should work like - remove duplicates as in Excel.

 

Hope someone can provide me with an idea. I have tried simple for loops, but in vain.

 

Thanks,

Arvind

2 REPLIES
Solution
Solution
Accepted by topic author Aravind2301
‎10-26-2016 01:43 PM

Re: Removing duplicate line items from tablefile object - Plant simulation

Arvind,

 

Here is a suggestion.

 

Assuming that the data is in a table:

  1. Sort table by part number
  2. Loop from last row to first (for i:=MyTable.YDim downto 2 loop etc.)
  3. If the part of row i = part in row i-1, add quantity of row i to quantity in row i-1 and remove the current row (MyTable.cutRow(i))

Simple, but should be effective.


Gert Nomden
Senior Consultant | Tecnomatix Product Manager
cardsplmsolutions.com

Re: Removing duplicate line items from tablefile object - Plant simulation

Nomden,

 

Thanks for your help. It worked like a charm!!

 

Arvind