Demo_User
(Demo User)
August 1, 2023, 3:53pm
1
Remove the duplicates column values from a particular column and store it in a data table
Input-Dt
Column1 column2
Tin. Ting
Mag. Mang
Sec. Ting
Tuy. Mang
output-Dt
Column1 column2
Tin. Ting
Tuy. Mang
Keep first
mkankatala
(Mahesh Kankatala)
August 1, 2023, 5:35pm
2
Hi @Demo_User
You can use the remove duplicate rows activity. Which uses to delete the duplicate rows in a specific column.
Hope it helps!!
Demo_User:
Keep first
Hi @Demo_User ,
From the Output required, it seems that you have Tuy
in the output where as it should have been Mag
as it is the first value. Is this a Typo ?
Also, You can check the below Expression for a Starter :
OutputDT = DT.AsEnumerable.GroupBy(Function(x)x("column2").ToString).Select(Function(x)x.First).CopyToDatatable
Here, DT
is the input Datatable, OutputDT
is a new Datatable variable.
Let us know if the above Expression is not what was required.
Demo_User
(Demo User)
August 2, 2023, 5:12am
4
Basically I want column2 value to be unique and store it to a string with semicolon seperated
O/p
String= Ting;Mang
@Demo_User ,
There is a better option for this case :
String.Join(";",DT.AsEnumerable.Select(Function(x)x("column2").ToString).Distinct.ToArray)
rlgandu
(Rlgandu)
August 2, 2023, 5:24am
6
@Demo_User
Assign activity:
dtUnique = dtOriginal.DefaultView.ToTable(True, “ColumnName”)
The DefaultView.ToTable(True, "ColumnName")
method creates a new DataTable (“dtUnique”) with distinct rows based on the specified column (“ColumnName”) from the original DataTable (“dtOriginal”). The True
parameter in the ToTable
method indicates that only unique rows should be included in the new DataTable.
Demo_User
(Demo User)
August 2, 2023, 6:10am
7
I have list of values
If those values contains @ then will store in a list again
Please suggest me with a query
@Demo_User ,
Could you maybe provide us with a Sample data and it’s Output, so we can clear of the requirement ?
Demo_User
(Demo User)
August 2, 2023, 6:33am
9
Input-lst
1233,566
Lisa@tinour
Welcome
Hung@345
Output
Lisa@tinour
Hung@345
I want the out which contains @ as a list
@Demo_User ,
Considering you already have the list now :
listVar = listVar.Where(Function(x)x.contains("@")).ToList
This should give the desired output.
Demo_User
(Demo User)
August 2, 2023, 12:42pm
11
It should contain @ and .com
Lis@ts.com
system
(system)
Closed
August 5, 2023, 12:43pm
12
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.