Hi Team,
Good Day!
How to compare if condition with excel values example as below:
I want to the give the value(8) from Excel
row(0).ToString.Length <8(I have more if conditions,so i want to pass these values from excel)
Hi Team,
Good Day!
How to compare if condition with excel values example as below:
I want to the give the value(8) from Excel
row(0).ToString.Length <8(I have more if conditions,so i want to pass these values from excel)
@RajeshT - Can you please explain in detail what you want to compare ?
okay @RajeshT ,
Try this condition.
row(0).ToString.Length < Cint(row(1).ToString)
here,
Cint(row(1).ToString) —> will get value from 2nd coulmn and convert it to Integer.
As you want it.
You can use For Each activity to compare all the values.
Use Read Range activity to read the excel into a datatable say DT.
For Each row in DT
{
if row(0).ToString.Length < Int32.Parse(row(1).ToString) Then
//True
else
//False
}
Hi @samir,
Thank you for the response.
I am comparing this part from Excel1 Sheet1 --row(0).ToString.Length
And this part from from another Excel2 Sheet1–CInt(row1(1).ToString)
If so willl the below flow is correct?
Yah of course
but ensure that once the match is found in the inner for each within IF condition else it will keep on looping so for that in the THEN part of if condition in the inner for each row loop use a BREAK activity
Cheers @RajeshT
Getting below error:
Hi @samir @Palaniyappan ,
Datatable i have mentioned wrogly thats what i got that error,but am facing the other issue after fixing that:
I think actually no, because this will compare 1 value from 1st excel to the all values from 2nd excel, Like cross product cartesian.
@RajeshT
So, I’ll suggest you to make index variable for both for each row activity as ind1 and ind2 resp. and make sequence as given below.
Hi @samir,
What is variable type for Ind1 and Ind2?
hey @RajeshT,
Here’s an example —> Compare2excel.zip (19.8 KB)
Check the excel file having sheets of data & Run it.
length < 8
This works Perfectly @samir.
Thanks a ton!!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.