Hi ,
I want to check all the values in a particular column is similar,if it is similar it should throw error.
ex:
kkk
kkk
kkk
In the above all values are similar to certain string(kkk), so it should throw error,
If the one value contains different then it should not throw error.
-
Use Read Range activity to read the data from excel file and it will give output as DataTable. Letās say āInputDTā.
-
And then try below expressions.
Int UniqueRowCount = InputDT.DefaultView.ToTable(True,"ColumnName").Rows.Count Int DuplicateRowCount = InputDT.DefaultView.ToTable(False,"ColumnName").Rows.Count If UniqueRowCount = DuplicateRowCount Then Column does not contain duplicate rows Else Column contains duplicate rows
Hi,
Another solution:
Can you try the following condition in IF activity?
dt.AsEnumerable.GroupBy(Function(r) r("TargetColumn").ToString).Count=1
Regards,
Hi
Hope the below steps would help you resolve this
-
Letās say you have a datatable named dt with the column values
And the same value lies in Column-2 -
Use a assign activity like this
int_rowcount = dt.Rows.Count
Where int_rowcount is a variable of type int32
- Now use a REMOVE DUPLICATE Rows ACTIVITY where pass input as dt and get the output as dt
- Now use a IF activity like this
int_rowcount <= dt.rows.count
If true it has no duplicate records where it goes to THEN block and if false it has duplicate records where it goes to ELSE block
In then block leave it as it is
And in else block use a THROW activity and mention like this
new BusinessRuleException(āYour exception messageā)
Cheers @karthik_kulkarni1
Thank you all for giving solutions
No,I dont have