-- 作者:石四
-- 发布时间:2016/3/4 9:30:00
-- 如果引用组合统计的分析结果进行计算
两组统计结果combine,有两个占比,怎么引用?
Dim Filter As String Filter = "部门系数 Is Not Null " DataTables("员工基本信息").LoadFilter = Filter DataTables("员工基本信息").Load()
Dim Filter0 As String Filter0 = "考勤日期 >= #1/1/2016# And 考勤日期 <= #1/31/2016# " DataTables("部门考勤").LoadFilter = Filter0 DataTables("部门考勤").Load()
Dim g1 As New GroupTableBuilder("统计表1", DataTables("部门考勤")) Dim dt1 As fxDataSource g1.Groups.AddDef("部门") g1.Groups.AddDef("人员编号") g1.Totals.AddDef("出勤") g1.GroupProportion = True dt1 = g1.BuildDataSource()
Dim g2 As New GroupTableBuilder("统计表2", DataTables("员工基本信息")) Dim dt2 As fxDataSource g2.Groups.AddDef("部门") g2.Groups.AddDef("人员编号") g2.Totals.AddDef("工作量比重") g2.GroupProportion = True dt2 = g2.BuildDataSource()
Dim nms As String() = {"部门","人员编号"} \'指定连接列 dt1.Combine(nms,dt2,nms) \'将销售统计数据组合到进货统计数据 dt1.Show("统计表1") \'显示统计结果
Tables("工资核算_Table5").DataSource = dt1 \'将统计结果绑定到Table With DataTables("工资核算_Table5").DataCols .Add("系数",Gettype(Double), "[占比] +[占比] / 2") End With
这样操作行不通!
|