Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
下载信息 [文件大小: 下载次数: ] | |
点击浏览该文件:a.table |
Dim dt As DataTable = DataTables("表A")
Dim tss As List(Of String) = dt.GetUniqueValues("[用户名称] Is Not NULL","用户名称")
For Each ts As String In tss
Dim drs As List(Of DataRow) = dt.Select("[用户名称] = '" & ts & "'", "投诉时间")
For i As integer = 1 To drs.Count - 1
Dim t As TimeSpan = drs(i)("投诉时间") - drs(i-1)("投诉时间")
drs(i)("第十列") = t.Days
Next
Next
For Each dr As DataRow In dt.DataRows
Dim Count As Integer = dt.Compute("Count(用户名称)","[用户名称] = '" & dr("用户名称") & "'")
Dim Count1 As Integer = dt.Compute("Count(第十列)","[用户名称] = '" & dr("用户名称") & "' And [第十列] = 0")
If dr.IsNull("投诉时间") = false Then
dr("重复投诉率") = Count1 / Count * 100
End If
Next
下载学习!
理解上应是这样吧,如果有10条投拆记录,有1条是符合属于重复投拆条件的,可以认为重复投拆率是10%。