Page 2 of 2

Posted: Thu Sep 21, 2006 11:36 pm
by ahmedwaseem2000
keshav0307 wrote:you can get the result by using combination of a SORT and transformation Stage.......
from file Sort on F1 Asc, F2 desc;

In Tnasform stage declare two stage variable VNext and VPriv

VNext=F1
Vpriv=Vnext

have two output from tansform

1st link constraint Vpriv<>Vnext
2nd link constraint Vpriv=Vnext
I am sorry!!! But the logic failed. could you please suggest me a new one????

Posted: Fri Sep 22, 2006 6:54 am
by keshav0307
it is tested one, there may be some mistake you are doing:

the order of defining stage variable is very important, i just noticed it was wrong earlier. try this

you can get the result by using combination of a SORT and transformation Stage.......
from file Sort on F1 Asc, F2 desc;

In Tnasform stage declare two stage variable VNext and VPriv

Vpriv=Vnext
VNext=F1

have two output from tansform

1st link constraint Vpriv<>Vnext
2nd link constraint Vpriv=Vnext

Posted: Fri Sep 22, 2006 9:40 am
by hxl208310
I think it's better to avoid using transformer. you can use 'remove duplicate' stage.
Pls find the difference based on keshav0307's method.

your data is like

F1 F2 F3
---------------
1 2 3
1 4 2
6 7 8
6 9 4

after sorting you will get

F1 F2 F3
---------------
1 4 2
1 2 3
6 9 4
6 7 8


remove duplicate be setting F1 as Key, and choose 'get first record' method to remove duplicate.


F1 F2 F3
---------------
1 2 3
6 7 8

Posted: Fri Sep 22, 2006 9:48 am
by keshav0307
Yes remove duplicate will work,
as i and Ray.Wurlod mentioned earlier, rule is same as remove duplicate.

partition and sort on on F1 asc, F2 Desc
and keep 1st
or
partition and sort on on F1 asc, F2 Asc
and keep last

Posted: Wed Sep 27, 2006 5:52 pm
by vijayrc
ahmedwaseem2000 wrote: Thanks keshav, i will try that tomorrow and let you know how it goes. And Finally can i conclude that each column that is passed through aggregator has to be either grouped or aggregated????
Yes..anything from the Input of Aggregator to get to Output of Aggregator should either be GROUP column[s] or the AGGREGATE columns. Correct me if I'm wrong.