使用Private orders
此字段
IF
{FIXED [Type], [Ordernumber] : COUNT([Ordernumber])} = 1
AND [Type] = 'Boxes' And [Priority] = 'Standard' And [DeliveryMethod] = 'UPS'
THEN 1 ELSE 0 END
对于所有盒子都使用这个
Sum(
If [Type] = 'Boxes' And [Priority] = 'Standard' then 1 else 0 end
)
所以对于最终输出,您可以直接说calculation2
Sum(
If [Type] = 'BOXES' And [Priority] = 'Standard' then 1 else 0 END
) -
Sum(IF
{FIXED [Type], [OrderNumber] : COUNT([OrderNumber])} = 1
AND [Type] = 'BOXES' And [Priority] = 'Standard' And [DeliveryMethod] = 'UPS'
THEN 1 ELSE 0 END)
对于匹配模式,将上述字段更改为calculation3
Sum(
If [Type] = 'BOXES' And [Priority] = 'Standard' then 1 else 0 END
) -
Sum(IF
{FIXED [Type], [OrderNumber] : COUNT([OrderNumber])} = 1
AND [Type] = 'BOXES' And [Priority] = 'Standard' And REGEXP_MATCH([DeliveryMethod], "UPS")
THEN 1 ELSE 0 END)
使用的数据
结果