Hi,

I have one structure named Company[id,name] and i am appending three different company in List of Company Structure but if i will append two company with same name in list then how can i find the duplicate company in List of company ?

Thanks & Regards

DM Singh

sorting by name and simply check current with previous for example.

if you store them in the database, just do a aggregate by name and then check on id...


J. wrote:

sorting by name and simply check current with previous for example.

if you store them in the database, just do a aggregate by name and then check on id...


Hi J,

If we don't have any unique attributes,how can we remove duplicate values from structure?


Regards,

Ronan


Ronan T wrote:

J. wrote:

sorting by name and simply check current with previous for example.

if you store them in the database, just do a aggregate by name and then check on id...


Hi J,

If we don't have any unique attributes,how can we remove duplicate values from structure?


Regards,

Ronan


Hi Ronan T,

What do you mean that there is no unique column in the structure , then in that case how you know if there is duplicate value .

As you mentioned , your structure has 2 columns namely Id and name , then in this case there can be only 3 possible cases to find duplicate .

1 .When you Id has same value .

2. When your Name column has same value .

3. Both your column has same value.

based on your requirement ,

 If you don't want to insert duplicate value then before appending to the list ,use listfilter and check the condition.

If you want to find if your list has duplicate value or not , loop through your list and user listfilter on the same list . If the filtered list has 2 or more value you have duplicate entry there.

If you are getting the list from Advance SQL or Aggregate then you can do as J suggested.


Hi DM,

If you are using version 11, you can use the ListDistinct to remove duplicates from a list.

Regards,

Daniel