Foxtable(狐表)用户栏目专家坐堂 → 复杂条件表达式


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

主题:复杂条件表达式

美女呀,离线,留言给我吧!
susu312
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:997 积分:6752 威望:0 精华:0 注册:2018/6/8 16:17:00
复杂条件表达式  发帖心情 Post By:2018/10/9 8:31:00 [显示全部帖子]

    'If vars("filter") <> "" Then
         'dt.Filter=vars("filter")
    'End If

    Dim dtb As New DataTableBuilder("占比统计表")
    dtb.AddDef("年龄",Gettype(String),32)
    dtb.AddDef("人数", Gettype(Integer))
    t=dtb.Build()
    For Each c As String In cs.split(",")
         Dim dr1  As DataRow = t.AddNew()
         Dim val As Integer = zd2(c)
         dr1("年龄") = c
         If val = 50 Then
              dr1("人数") = dt.Compute("Count(name)", "age" & " < 60 " )
         Else If val = 90
              dr1("人数") = dt.Compute("Count(name)", "age" & " >= 90" )
         Else
              dr1("人数") = dt.Compute("Count(name)", "age" & " >= " &  val & "  And " & "age" & " < "& val+10 &"" )
         End If
   Next
   'dt.Filter=""

 

 

红色部分是条件,可以吧那个条件放到compute语句中么?


 回到顶部