Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
Dim drs As List(Of DataRow) = DataTables("标录明细").Select("[有效评标价] > 0 And [项目名称] = '半山单元高中(暂名) 监理'",
"有效评标价 DESC")
Dim n As Integer = Round2(drs.Count * 0.1,0)
If drs.Count >= n *2 Then
'▂▂▂▂▂▂▂ 去除极端值 ▂▂▂▂▂▂▂
drs.RemoveRange(0, n) '直接移除区间
drs.RemoveRange(drs.Count - n, n)
'▂▂▂▂▂▂▂ 计算平均值 ▂▂▂▂▂▂▂
Dim sum As Double = 0
For Each dr As DataRow In drs
sum += dr("有效评标价")
Next
Dim avg As Double = sum / drs.Count
avg = avg * 0.98 ‘下浮系数2%
msgbox(avg)
'▂▂▂▂▂▂▂ 集合方式筛选 ▂▂▂▂▂▂▂
Dim diffDict As New Dictionary(Of DataRow, Double)
For Each dr As DataRow In drs
diffDict(dr) = Math.Abs(dr("有效评标价")
- avg)
Next
Dim entryList As New List(Of KeyValuePair(Of
DataRow, Double))(diffDict)
entryList.Sort(Function(x, y) x.Value.CompareTo(y.Value))
'▂▂▂▂▂▂▂ 生成结果表 ▂▂▂▂▂▂▂
For
i As Integer = 0 To Math.Min(14, entryList.Count - 1)
Dim drSource = entryList(i).Key
Output.Show(drSource("投标单位")
& "="
& drSource("有效评标价"))
Next
MessageBox.Show("处理完成,平均值:{avg:N2}")
Else
MessageBox.Show("有效数据不足")
End If