I am trying to get the bank name with the lowest value from vs BNM (Buy) and put it into the To Buy, may I know how can I do this using UI path?
@hjie30
Welcome to UiPath Community.
Read the excel and store it in datatable
minVal = dtFiltered.AsEnumerable.Min(Function (x) CDbl(x(“vsBNM(Buy)”).toString.Trim))
maxVal= dtFiltered.AsEnumerable.Max(Function (y) CDbl(y(“vs BNM(Buy)”).toString.Trim))
Write max value or min value in the respective cell in excel.
Hi,
Can you try to set DataRow array?
DataRow()
Regards,
Okay the data type change fixed the issue, but now I have another issue with the column “vs BNM (Buy)” May I know how to solve it? The vs BNM (Buy) is present in table sheet1, I even copy the column name but seem like doesn’t work
Hi,
As the table starts from B4, it’s necessary to set the following In ReadRange?
Excel.Sheet("Sheet1").Range("B4")
OR
Excel.Sheet("Sheet1").Range("B4:G9")
Regards,
Okay it works! thanks a lot Yoichi. I have another issue is that how do I exclude the Bank BNM for minimum and maximum calculation?
Thanks Sangeetha for the solution but I think I will stick to Yoichi’s solution
HI,
Can you try the following expression?
dt.AsEnumerable.Where(Function(r)r("Bank").ToString<>"BNM").OrderBy(Function(r) Double.Parse(r("vs BNM (Buy)").ToString)).ToArray()
Regards,
Thank you very much Yoichi, you solved all my issue. Have a nice day!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.