很简单的DW的问题,帮解决了马上给分
grid风格的dw
ybh xs
123 2
123 2
123 2
456 1
456 1
789 4
789 4
TOTAL:2+1+4=7
如何在下面的汇总里统计出xs这列按ybh分组后的和,即2+1+4=7
我这样写的:sum(xs for all) ,可结果却是2+2+2+1+1+4+4,想去掉重复,该怎么写这个汇总函数呢
右边写你的计算域
先分组 sum( contract_comesthefunds for group 1 )
再统计 sum(xs for all)
[解决办法]
sum(xs for all DISTINCT)
[解决办法]
看帮助 Sum DataWindow expression function
Sum ( column { FOR range { DISTINCT { expres1 {, expres2 {, ... } } } } } )
Assuming a DataWindow object displays the order number, amount, and line items for each order, this computed field returns the sum of the order amount for the distinct order numbers:
Sum(order_amt for all DISTINCT order_nbr)