Calculate the lowest excel value

good afternoon
I would like to know if there is any term of visual basic or another method in uipath to determine the least amount, if so, how could I do it: I have a “for each row” where I extract data, then I put an “if” condition to determine a logic , where the data I need is thrown in excel (example; Cant1, Cant2 and Cant3); of these results I want to know which is the minor and to write it in excel
thank you

If you read the excel and store the data in a DataTable, you can use a LINQ function inside a Select to get the minimum value of a column and assign it to a variable. It’ll be something like this:

minValue = CInt(dtVariable.Select("ColName = MIN(ColName)")(0)("ColName"))

This selects the row from the DataTable that has the minimum value in the column named ColName, then the (0)("ColName") at the end are used to retrieve the value.

3 Likes

@nerlichman
In what way could I do this? I didn’t understand you

Hi @borismh,

To do what @nerlichman is saying what you have to do is use the read range activity.
image
Any of these are fine but the excel one must be inside an excel scope and you must have excel install. I recommend the workbook one.
Just enter here the info:
image
if you leave the range empty like this “” it will read all the sheet in output just enter a datatable variable for that just press ctrl + k to create it.
image
using an assign activity use @nerlichman method.

image
I hope this helps.

1 Like

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