Foxtable(狐表)用户栏目专家坐堂 → 有点麻烦的计算问题


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

主题:有点麻烦的计算问题

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/11/7 13:07:00 [显示全部帖子]

比如

 

(iif(库存_28=0 and 销售_28<>0, 1, 0) + iif(库存_29=0 and 销售_29<>0, 1, 0)) / (iif(销售_28>0, 1, 0) + iif(销售_29>0, 1, 0))

[此贴子已经被作者于2017/11/7 13:07:48编辑过]

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/11/7 16:33:00 [显示全部帖子]

Dim dic_xl As new Dictionary(Of String, String)
Dim dic_kc As new Dictionary(Of String ,String)
For Each c2 As Col In Forms("AA").Controls("table2").Table.Cols
    If c2.Caption.Contains("销售数量_") And c2.Caption.Contains("店仓名称") = False Then
        Dim v  = c2.Caption.Replace("销售数量_","")
        dic_xl.add(v, c2.name)
    End If
    If c2.Caption.Contains("可用库存_") And c2.Caption.Contains("店仓名称") = False Then
        Dim v  = c2.Caption.Replace("可用库存_","")
        dic_kc.add(v, c2.name)
    End If
Next

For Each r2 As Row In Forms("AA").Controls("table2").Table.Rows
    Dim count1 As Integer = 0
    Dim count2 As Integer = 0
    For Each key As String In dic_xl.Keys
        If r2(dic_xl(key)) > 0 Then '
            count1 += 1
            If r2(dic_kc(key)) = 0 Then
                count2 += 1
            End If
        End If
    Next
    If count1 > 0 Then
        r2("断码率") = count2 / count1
    else
        r2("断码率") = nothing
    end if
   
Next


 回到顶部