是有点问题,要用代码处理一下。
Dim g As New CrossTableBuilder("统计表1", DataTables("交叉统计测试"))
g.HGroups.AddDef("商品")
g.HGroups.AddDef("品名")
g.VGroups.AddDef("尺寸名")
g.Totals.AddDef("数量", "数量")
g.VerticalTotal = True
g.VerticalProportion = True
g.Build()
For Each c As Col In Tables("统计表1").Cols
If c.Caption Like "*占比" Then
Dim name As String = c.name.Replace("vp", "")
Dim sum As Double = Tables("统计表1").Compute("sum(" & name & ")", "商品 <> '合计'")
For Each r As Row In Tables("统计表1").Rows
r(c.name) = r(name) / sum
Next
End If
Next
MainTable = Tables("统计表1")