How to find duplicate valus through if condition

hai guys ,
i have numbers in excel like
1
1
1
2
2
2
3
3
3
but i want only 1 and ignore all 1’s. And then 2 and 3 through if condition.

2 Likes

HI @Arjun_Reddy

you can use read range activity to first read the data onto a datatable. Next use remove duplicate rows activity to remove the duplicates your have in your dataset…

This will work for you

hai @Lahiru.Fernando
but i want to use if condition

@Arjun_Reddy will u send ur screen shot of Excel file

Capture

You need to get the distinct values ?
First read the excel using readrange
then use as such below
DataTable distinctValues = view.ToTable(true, “Column1”)

Hi,

this might help you, let us know the result

DataTable =DataTable.DefaultView.ToTable(true)

Regards,
Pavan H

Use this and check

DataTable dt=dt.DefaultView.ToTable(true, “Column1”)
or
DataView view = new DataView(table)
DataTable distinctValues = view.ToTable(true, “Column1”, “Column2” …)
or
DataTable =DataTable.DefaultView.ToTable(true)

place the condition in assign activity.

More over i dont think you need For each activity .

@Arjun_Reddy

If you just want the values, use HashSet.

If you need to loop over the rows and use If, create an empty List variable (like Processed), loop over each row and check if the List variable contains the value (Processed.Contains(ThisValue)) and if not do what you have to do and and the value to the list.