易表在线答疑技术与交流用户社区 → 分类汇总函数可不可以只对超过一条相同条件的记录进行汇总?


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

主题:分类汇总函数可不可以只对超过一条相同条件的记录进行汇总?

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


加好友 发短信
等级:论坛游民 帖子:73 积分:0 威望:0 精华:0 注册:2007/4/9 12:45:00
  发帖心情 Post By:2007/4/21 18:04:00 [显示全部帖子]

设1数值型变量:%zsl%

ClearSubtotal() And DelFor(Grid,"料号","=","") And DelFor(Grid,"料号","instr","小计") And DelFor(Grid,"料号","=","总计") And Eval("SetVariable(""%zsl%"","+text(sumfor(Grid,"数量"))+")")And CreateGrid(".","料号",0,"数量",1,"Y",3) And Cleargrid(grids) and CopyRows(grids) And DelRow(grids,1) And Do(220,1) and EvalFor(grid,"料号","IF(if(FindRow(Grids,""料号"",""="",[料号],2)=0,ReplaceFor(Grids,""Y"",-1,""料号"",""="",[料号]),True),[料号],[料号])",0,0,1) And DelFor(grids,"Y","=",-1) And EvalFor(grids,3,"SubtotalFill(Grids,""料号"",""数量"",2)",1,1) And EvalFor(grids,1,"[料号]+""小计""","料号", "<>" ,"总计") And Do(112) and AppendRows(grids) And RemoveGrid(grids)And SetCellText(Grid,Rows,"数量",[%zsl%]) And SortCol(Grid,"料号",1)And EvalFor(Grid,"料号","""小计 ""+Substitute([料号],""小计"","""")","料号", "instr" ,"小计") And MarkRowFor(12910591,0,"料号", "instr" ,"小计")And MarkRowFor(8453888,0,"料号","=","总计")


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


加好友 发短信
等级:论坛游民 帖子:73 积分:0 威望:0 精华:0 注册:2007/4/9 12:45:00
  发帖心情 Post By:2007/4/23 10:26:00 [显示全部帖子]

给你个简单点的:

If(cell(Rows,"料号") = "总计",ClearSubtotal(),Subtotal("料号","数量",2) And EvalFor(grid,"料号","If(FindRow(Grid,""料号"",""="",Substitute([料号],""小计 "",""""),2)=0,If(DelRow(Grid,Row),[料号],[料号]),[料号])","料号","instr","小计"))


 回到顶部