Difference B/W Mm:ss column Compare Value

Hi Guys

I have asked one question many times on UiPath forum


Input_Result_1.xlsx (9.2 KB)
didn’t get any exact answer.
Please help me.
I have an excel which has two columns first(Actual State),the value that is coming in the actual state is minute and second. Second value(Threshold Failed), value that is coming in the Threshold Failed is minute and second. I want Actual State>=Threshold Failed if this value is found in excel then create a new output excel(yellow line will be the actual result)

Hi,

Can you try the following?

arrDr =dt.AsEnumerable.Where(Function(r) New TimeSpan(0,CInt(r("Time in State").ToString.Split(":"c)(0)),CInt(r("Time in State").ToString.Split(":"c)(1)))>New TimeSpan(0,CInt(r("Threshold Failed").ToString.Split(":"c)(0)),CInt(r("Threshold Failed").ToString.Split(":"c)(1)))).ToArray()

Sample20230529-2aL.zip (9.6 KB)

Regards,

@Yoichi


When i tried using this code for another excel file it is getting error
Input_11.xlsx (10.4 KB)

Hi,

Because there are empty cells in threshold column. How do you want to handle it?

image

Regards,

I do’nt want blank value having threshold value only that value should come in output.
Input_11.xlsx (10.6 KB)
Ex-output excel(yellow line will be the actual result)

Hi,

Can you try the following sample?

arrDr = dt.AsEnumerable.Where(Function(r) not String.IsNullOrEmpty(r("Threshold Failed").ToString) AndAlso New TimeSpan(0,CInt(r("Time in State").ToString.Split(":"c)(0)),CInt(r("Time in State").ToString.Split(":"c)(1)))>New TimeSpan(0,CInt(r("Threshold Failed").ToString.Split(":"c)(0)),CInt(r("Threshold Failed").ToString.Split(":"c)(1)))).ToArray()

Sample20230529-2aLv2.zip (17.7 KB)

Regards,

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