如何从Webmethods中的文档列表中删除重复文档?

时间:2016-02-28 14:38:37

标签: webmethods

我有输入文档列表,其中包含AccountID和Amount字段,这些字段重复了AccountID,但具有不同的金额。我如何使用唯一的AccountID来形成ouput doclist,但总结的数量是多少?

Ex:InputDocList Doc [0]:AccountID = 111         金额= 100

Doc [1]:AccountID = 222         金额= 200

Doc [2]:AccountID = 111         金额= 300

Doc [3]:AccountID = 222         金额= 500

OutputDocList应如下所示: Doc [0]:AccountID = 111         金额= 400

Doc [1]:AccountID = 222         金额= 700

1 个答案:

答案 0 :(得分:3)

我会使用pub.document:groupDocuments按AccountID对文档进行分组。这将为您提供每个唯一帐户ID的组。

然后,对于每个组,使用pub.math:addInt/FloatList对金额求和,并将结果映射到 {AccountID,totalAmount} 文档的新列表。

相关问题