Foxtable(狐表)用户栏目专家坐堂 → [求助]统计汇总


  共有6148人关注过本帖树形打印复制链接

主题:[求助]统计汇总

帅哥哟,离线,有人找我吗?
有点甜
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/1/14 9:43:00 [显示全部帖子]

参考

 

Dim ls As new List(Of String)
Dim dt As Table = Tables("表A")
For Each dc As Col In dt.Cols
    If dc.Caption.StartsWith("第") Then
        ls.add(dc.name)
    End If
Next
Dim ary1(ls.count-1) As Double
Dim ary2 = ls.ToArray
For i As Integer = 0 To ary2.length-1
    ary1(i) = dt.compute("count(_Identify)", ary2(i) & " is not null")
Next
array.sort(ary1, ary2)
For i As Integer = 0 To ary2.length-1
    dt.Cols(ary2(i)).Move(0)
Next


 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/1/14 10:35:00 [显示全部帖子]

上传具体项目测试。

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/1/14 11:08:00 [显示全部帖子]

这个意思?

 

Dim ls As new List(Of String)
Dim dt As Table = Tables("information")
For Each dc As Col In dt.Cols
    If dc.Caption.StartsWith("开奖号码分布_") Then
        ls.add(dc.name)
    End If
Next
Dim ary1(ls.count-1) As Double
Dim ary2 = ls.ToArray
For i As Integer = 0 To ary2.length-1
    ary1(i) = dt.compute("count(_Identify)", ary2(i) & " is not null")
Next
array.sort(ary1, ary2)
For i As Integer = 0 To ary2.length-1
    dt.Cols(ary2(i)).Move(6)
Next


 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/1/14 11:21:00 [显示全部帖子]

这个意思?

 

Dim dt As Table = Tables("information")
Dim dic As new Dictionary(of String, Integer)
For Each r As Row In dt.Rows
    Dim ary() As String = {r("开奖号码_A"),r("开奖号码_B"), r("开奖号码_C"), r("开奖号码_D"), r("开奖号码_E")}
    array.sort(ary)
    Dim str = String.Join(",", ary)
    If dic.ContainsKey(str) = False Then
        dic.Add(str, 1)
    Else
        dic(str) += 1
    End If
Next
Dim ary1(dic.Keys.count-1) As String
Dim ary2(dic.Keys.count-1) As Integer
Dim i As Integer = 0
For Each key As String In dic.Keys
    ary1(i) = key
    ary2(i) = dic(key)
    i += 1
Next
array.sort(ary2, ary1)
For i = ary2.length-1 To 0 Step -1
    output.show(ary1(i) & ":" & ary2(i))
Next


 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/1/14 11:50:00 [显示全部帖子]

output.show,显示在命令窗口里面的

 

http://www.foxtable.com/webhelp/scr/2642.htm

 


 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  6楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/1/14 16:21:00 [显示全部帖子]

Dim dt As Table = Tables("information")
Dim dic As new Dictionary(of String, Integer)
For Each r As Row In dt.Rows
    Dim ary() As String = {r("开奖号码_A"),r("开奖号码_B"), r("开奖号码_C"), r("开奖号码_D"), r("开奖号码_E")}
    array.sort(ary)
    Dim str = String.Join(",", ary)
    If dic.ContainsKey(str) = False Then
        dic.Add(str, 1)
    Else
        dic(str) += 1
    End If
Next
Dim t As Table = Tables("表A")
t.StopRedraw
t.DataTable.DataRows.Clear
For Each key As String In dic.Keys
    Dim nr As DataRow = t.DataTable.addnew
    nr("第一列") = key
    nr("第二列") = dic(key)
Next
t.ResumeRedraw
t.sort = "第二列 desc"

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  7楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/1/15 10:32:00 [显示全部帖子]

Dim dt As Table = Tables("information")
Dim dic As new Dictionary(of String, Integer)
For Each r As Row In dt.Rows
    Dim ary() As String = {r("开奖号码_A"),r("开奖号码_B"), r("开奖号码_C"), r("开奖号码_D"), r("开奖号码_E")}
    For Each s As String In ary
        Dim ary1(3) As String
        Dim i As Integer = 0
        For Each s1 As String In ary
            If s <> s1 Then
                ary1(i) = s1
                i+=1
            End If
        Next
        array.sort(ary1)
        Dim str = String.Join(",", ary1)
        If dic.ContainsKey(str) = False Then
            dic.Add(str, 1)
        Else
            dic(str) += 1
        End If
    Next
Next
Dim t As Table = Tables("表A")
t.StopRedraw
t.DataTable.DataRows.Clear
For Each key As String In dic.Keys
    Dim nr As DataRow = t.DataTable.addnew
    nr("第一列") = key
    nr("第二列") = dic(key)
Next
t.ResumeRedraw
t.sort = "第二列 desc"

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  8楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/1/15 12:12:00 [显示全部帖子]

Dim dt As Table = Tables("information")
Dim dic As new Dictionary(of String, Integer)
For Each r As Row In dt.Rows
    Dim ary() As String = {r("开奖号码_A"),r("开奖号码_B"), r("开奖号码_C"), r("开奖号码_D"), r("开奖号码_E")}
    For i As Integer = 0 To ary.length-1
        For j As Integer = i+1 To ary.length-1
            For k As Integer = j+1 To ary.length-1
                Dim ary1() As String = {ary(i), ary(j), ary(k)}
                array.sort(ary1)
                Dim str = String.Join(",", ary1)
                If dic.ContainsKey(str) = False Then
                    dic.Add(str, 1)
                Else
                    dic(str) += 1
                End If
            Next
        Next
    Next
Next
Dim t As Table = Tables("表A")
t.StopRedraw
t.DataTable.DataRows.Clear
For Each key As String In dic.Keys
    Dim nr As DataRow = t.DataTable.addnew
    nr("第一列") = key
    nr("第二列") = dic(key)
Next
t.ResumeRedraw
t.sort = "第二列 desc"

 回到顶部