Hi @peter liles
According to my understanding, as long as the data in this table exists with the same VendorID, its ShippingFee will be reduced by 10%. Then we can divide the data into several groups according to the VendorID, and then count the number of data in the group, and then proceed to the next step.
Code:
Dim query=from list in products
group list by list.VendorID;
For Each listgroup In query
For Each list In listgroup
Dim number As Integer = listgroup.Count()
list.ShippingFee = list.ShippingFee * Math.Pow(0.9, number - 1)
Console.WriteLine($" {listgroup.Count()},{list.VendorID},{list.ProductID},{list.Description},{list.Price},{list.ShippingFee}")
Next
Next
Output:
If there is a discrepancy with your request, please update the request further. I will continue to help you solve the problem.
Best Regards
Qi You
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.