Data Table example
this is going to be hard to explain!
I'm only looking to get rows for all items that
the sum of itemvalue > 0 where dbfmlivedataid is the same and item is not 9
In my example I would be looking to get returned ;
“eac69a0a-7c41-e811-8421-00155d01e101”, 9, 1.00
“eac69a0a-7c41-e811-8421-00155d01e101”, 1, 10.00
“eac69a0a-7c41-e811-8421-00155d01e101”, 3, -2.00
(itemvalue 10.00 + -2.00) > 0
"fdc79a0a-7c41-e811-8421-00155d01e101”, 9, 0.00
“fdc79a0a-7c41-e811-8421-00155d01e101”, 1, 25.00
“fdc79a0a-7c41-e811-8421-00155d01e101”, 2, 72.00
(item value 25.00 + 72.00) > 0
No record to be returned for;
“62109810-7c41-e811-8421-00155d01e101”, 9, 10.50 as there is no other records with the same dbfmlivedataid
“3cc69a0a-7c41-e811-8421-00155d01e101”, 9, 8.00
“3cc69a0a-7c41-e811-8421-00155d01e101”, 1, 19.00
“3cc69a0a-7c41-e811-8421-00155d01e101”, 8, -20.00
would also not be returned as itemvalue 19.00 + -20.00 ) = -1 which is < 0
“36d79016-7c41-e811-8421-00155d01e101”, 9, 5.00
“36d79016-7c41-e811-8421-00155d01e101”, 1, 5.00
“36d79016-7c41-e811-8421-00155d01e101”, 8, -5.00
would also not be returned as itemvalue 5.00 + -5.00 ) = 0 which is 0
any help on this nightmare would be most useful
Dim _weeklyprocTable As DataTable = New DataTable _weeklyprocTable.Columns.Add("dbfmlivedataid", GetType(System.String)) _weeklyprocTable.Columns.Add("item", GetType(System.Int32)) _weeklyprocTable.Columns.Add("itemvalue", GetType(System.Decimal)) _weeklyprocTable.Rows.Add(“eac69a0a-7c41-e811-8421-00155d01e101”, 9, 1.00) _weeklyprocTable.Rows.Add(“eac69a0a-7c41-e811-8421-00155d01e101”, 1, 10.00) _weeklyprocTable.Rows.Add(“eac69a0a-7c41-e811-8421-00155d01e101”, 3, -2.00) _weeklyprocTable.Rows.Add(“62109810-7c41-e811-8421-00155d01e101”, 9, 10.50) _weeklyprocTable.Rows.Add(“fdc79a0a-7c41-e811-8421-00155d01e101”, 9, 0.00) _weeklyprocTable.Rows.Add(“fdc79a0a-7c41-e811-8421-00155d01e101”, 1, 25.00) _weeklyprocTable.Rows.Add(“fdc79a0a-7c41-e811-8421-00155d01e101”, 2, 72.00) _weeklyprocTable.Rows.Add(“3cc69a0a-7c41-e811-8421-00155d01e101”, 9, 8.00) _weeklyprocTable.Rows.Add(“3cc69a0a-7c41-e811-8421-00155d01e101”, 1, 19.00) _weeklyprocTable.Rows.Add(“3cc69a0a-7c41-e811-8421-00155d01e101”, 8, -20.00) _weeklyprocTable.Rows.Add(“36d79016-7c41-e811-8421-00155d01e101”, 9, 5.00) _weeklyprocTable.Rows.Add(“36d79016-7c41-e811-8421-00155d01e101”, 1, 5.00) _weeklyprocTable.Rows.Add(“36d79016-7c41-e811-8421-00155d01e101”, 8, -5.00)
this is going to be hard to explain!
I'm only looking to get rows for all items that
the sum of itemvalue > 0 where dbfmlivedataid is the same and item is not 9
In my example I would be looking to get returned ;
“eac69a0a-7c41-e811-8421-00155d01e101”, 9, 1.00
“eac69a0a-7c41-e811-8421-00155d01e101”, 1, 10.00
“eac69a0a-7c41-e811-8421-00155d01e101”, 3, -2.00
(itemvalue 10.00 + -2.00) > 0
"fdc79a0a-7c41-e811-8421-00155d01e101”, 9, 0.00
“fdc79a0a-7c41-e811-8421-00155d01e101”, 1, 25.00
“fdc79a0a-7c41-e811-8421-00155d01e101”, 2, 72.00
(item value 25.00 + 72.00) > 0
No record to be returned for;
“62109810-7c41-e811-8421-00155d01e101”, 9, 10.50 as there is no other records with the same dbfmlivedataid
“3cc69a0a-7c41-e811-8421-00155d01e101”, 9, 8.00
“3cc69a0a-7c41-e811-8421-00155d01e101”, 1, 19.00
“3cc69a0a-7c41-e811-8421-00155d01e101”, 8, -20.00
would also not be returned as itemvalue 19.00 + -20.00 ) = -1 which is < 0
“36d79016-7c41-e811-8421-00155d01e101”, 9, 5.00
“36d79016-7c41-e811-8421-00155d01e101”, 1, 5.00
“36d79016-7c41-e811-8421-00155d01e101”, 8, -5.00
would also not be returned as itemvalue 5.00 + -5.00 ) = 0 which is 0
any help on this nightmare would be most useful