How to select max value of a column from a Datarow array in Uipath

Is there a method to select the maximum value of an integer column from a Datarow array in Uipath. Do not want to convert the Datarow array to Datatable as there is a specific index of the DataRow array to be maintained. If it’s possible using LINQ query, using Datarow array please let me know how to go about it.

@mailsmithash
YourDataRowArrayVar.Max(Function ( r ) Cint(r(YourColumnIndexOrName).toString.Trim))

a variation to the int converion if we can rely on the datatype from column

YourDataRowArrayVar.Max(Function ( r ) r.Field(Of Int32)(“YourColumnIndexOrName”))

1 Like

Thanks for the reply, will test it.

Using the query as below:
cashLevRows.Max(Function ( r ) r.Field(Of Double)(“Result”))

but getting an error “Sequence contains no elements”

@mailsmithash
In General thats Not a Bug in Statement. The Data Return No row Back. Here IT has to investigate

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