Hi everyone,

I’ve run into a problem as I cannot get a proper working linq statement her.

Suppose I have a DataTable with x rows and I have to sort based on the sum of the column **Quantity**. Then I have a condition **Requested Quantity** = 20. I need to find the rows equal to the exact sum of RequestedQuantity only where the combination of **3** rows is equal to it.

Bin Quantity

1 10

2 5

3 5

4 10

5 15

I can’t seem to figure out the proper linq syntax to get this to work. My starting point is this:

(From row In StorageBins.AsEnumerable.GroupBy( _

Convert.ToDouble(Function (x) x(“Quantity”), cultureInfo)).Sum( _

Function (y) Convert.ToDouble(y(“Quantity”), cultureInfo) = Double.Parse(RequestedQuantity,cultureInfo)))

Initially I am just trying it to do so I get any rows that is equal to my condition, without the exact 3 rows. However that is my end-goal.

I’m not an expert in Linq unfortunately. I hope some of you might be!

Thanks