Удаление дубликатов и отправка письма

Здравствуйте, задача такая.
Найти в Excel файле дубликаты, удалить их и посчитать итоговую сумму оставшихся строк. И отправить на почту.
Я все написал, сумму считает, но проблема в том что дубликаты почему то не удаляет, не пойму в чем причина…

Hi @antonstep9213

You can try with remove duplicate rows activity and pass your datatable here
image

Regards
Sudharsan

Hi @antonstep9213

Welcome to UiPath community

Can you share the input and expect output

You can also try this

If you want to remove the duplicate rows based on one column check with this expression

(From p in DT.Select() where( From q in DT.Select() where q(“NLC”).Equals(p(“NLC”)) Select q).ToArray.Count=1 Select p).ToArray.CopyToDataTable()

If you need to get only the rows with one occurence means check with this expression

DT.AsEnumerable().GroupBy(Function(a) a.Field(Of String)(1)).Select(Function(b) b.First).CopyToDataTable()

You can also try with this

Datatable.DefaultView.Totable(true, {"list", "of", "column","names"})

Regards
Sudharsan

Я использовал Remove Duplicate Rows, но он почему то не удаляет дубликаты при компиляции программы.
Форум не разрешает прикрепить скриншоты программы или ее тело…

Try with these @antonstep9213

You can also try with the below activity

Regards
Sudharsan

1 Like

HI @antonstep9213

How about this expression

(From d In DtBuild.AsEnumerable
Group d By k=d("Column Name").toString.Trim Into grp = Group
Let ra = New Object(){k,grp.First()(1)}
Select r = DtOutput.Rows.Add(ra)).CopyToDataTable

Check out the XAML file

Duplicate&Sum.xaml (9.1 KB)

Regards
Gokul

Спасибо за помощь! Заработало!
Этот пакет помог, но неужели нельзя сделать это с помощью стандартных блоков?

I can’t get you , can you elaborate ? @antonstep9213

Are you asking about activities?

да о стандартных активностях

No we only have these activities @antonstep9213
Remove duplicates and you said it is not working in your case

other than that we have a modern design activity called Remove duplicates it will remove directly in the excel
image

Regards
Sudharsan

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.