以文本方式查看主题
- Foxtable(狐表) (http://foxtable.net/bbs/index.asp)
-- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2)
---- [求助] 根据两例的值进行递增减 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=101308)
|
-- 作者:yupeng
-- 发布时间:2017/5/27 23:04:00
-- [求助] 根据两例的值进行递增减
老师 您好
根据图1的条件,怎样才能达到图2的效果。请问按什么思路进行?请讲详细一点。谢谢
此主题相关图片如下:图1.jpg
此主题相关图片如下:图2.jpg
|
-- 作者:有点色
-- 发布时间:2017/5/28 9:49:00
--
Dim t As Table = Tables("表B") Dim max As Integer = 0 Dim idx As Integer = 0 Dim cs As new List(Of String) For Each c As Col In t.cols If c.Name.StartsWith("第") Then Dim count As Integer = t.Compute("count(" & c.name & ")", c.name & " is not null") If count > max Then max = count idx = cs.count End If cs.add(c.name) End If Next msgbox(idx) For i As Integer = 0 To cs.count-1 If i <> idx Then For Each r As Row In t.rows r(cs(i)) = r(cs(idx)) - val(r("第十列"))*(idx-i) Next End If Next
|