首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > PB >

数据窗口里的统计解决办法

2012-02-28 
数据窗口里的统计在数据窗口里有如下字段及数据(定义code为组:group 1):code quantity type0001 10入仓000

数据窗口里的统计
在数据窗口里有如下字段及数据(定义code为组:group 1):
code quantity type
0001 10 入仓
0001 20 出仓
0001 10 入仓
0001 20 入仓
0002
...
0003
...
增加一计算列
用以下SUM可以统计0001组的入仓的数为:40
sum(if(type='入仓',0,quantity) for group 1)
=40

但我现想统计以组的入仓的个数时,就不知这语句如何写???
count(if(type='入仓',?,?) for group 1)
结果为3
请教!

[解决办法]
sum(if(type='入仓',0,1) for group 1)

热点排行