以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 在临时表中的年龄数值分布怎么编码? (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=133884) |
||||
-- 作者:yfy13338431925 -- 发布时间:2019/4/22 22:03:00 -- 在临时表中的年龄数值分布怎么编码? 甜哥,统计政治面貌的年龄分布我做了一个临时表,数值分布不会,麻烦您了! Dim dic As new Dictionary(of String, String)
|
||||
-- 作者:有点蓝 -- 发布时间:2019/4/22 22:56:00 -- Dim dt As DataTable =DataTables("人事档案基础信息") Dim t1 As Table =Tables("统计2") t1.StopRedraw \'统计编码 For Each sr As String() In dt.GetValues("工作单位|所在部门|政治面貌") Dim r2 As Row = t1.AddNew r2("工作单位") = sr(0) r2("所在部门") = sr(1) r2("政治面貌") = sr(2) Dim flt As String = "工作单位 = \'" & sr(0) & "\' and 所在部门 = \'" & sr(1) & "\' And 政治面貌 = \'" & sr(2) & "\'" For Each dc As Col In t1.Cols Dim filter As String = flt If dc.Name.Contains("岁") Then If dc.Name.Contains("岁以下") Then filter &= " and 年龄 < " & dc.name.split("岁")(0) ElseIf dc.Name.Contains("岁以上") Then filter &= "and 年龄 >= " & dc.name.split("岁")(0) Else Dim arr() As String = dc.name.split("-") filter &= "and 年龄 >= " & arr(0).split("岁")(0) & " And 年龄 < " & arr(1).split("岁")(0) End If r2(dc.name) =dt.Compute("Count(姓名)",filter ) End If Next Next
|