本文共 1039 字,大约阅读时间需要 3 分钟。
Thanks for your response. Here is the sample data information:B 2 $120
One way to do this is to use 2 aggregators. The First aggregator group and sum amt by Name and ID.
So if I remove the duplicate row in the Sorter I will get incorrect distinct-count and totalamt for "A".
There are two different ways.
1) Suggested by Manas - to use two aggregates.
2)Flaging the record as 1 and 0 before aggregate. For this, you should have sorted data on name and id.
If you have sorted data coming from source, try 2nd option as given below.
In expression transformation before aggregator.
IN_ID
v_ID_CNT = IIF(ISNULL(v_ID) Or IN_ID!= V_ID,1, 0)
O_ID_CNT=V_ID_CNT
V_ID=IN_ID
O_ID_CNT will go in to your aggregator.
You need to create one more port in aggregator for SUM(O_ID_CNT) which will return the distinct count of IDs.
(No change in GROUP BY columns)
转载地址:http://ozrli.baihongyu.com/