Which LINQ query can be used to return the maximum total Quantity?

Considering that the attached table is stored in a variable called “dt”.

Which LINQ query can be used to return the maximum total Quantity?
A . dt.AsEnumerable. GroupBy(Function(x)x("Item"). ToString). Max(Function(x)x.Sum(Function(y) Convert.Tolnt32(y("Quantity").ToString)))
B . dt.AsEnumerable. Max(Function(x) Convert. Tolnt32(x("Quantity"). ToString))
C . dt.AsEnumerable. Max(Function(x) Convert.Tolnt32(x("Quantity"). ToString))("Item")
D . dt.AsEnumerable. OrderByDescending(Function(x) Convert. Tolnt32(x("Quantity").ToString)). First.Item("Quantity")

Answer: A

Explanation:

https://docs.uipath.com/activities/docs/linq-orderbydescending

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments