Page 1 of 1

Aggregation By row-wise

Posted: Wed Sep 04, 2013 10:55 am
by Prince_Hyd
Hello Folks

I have a scenario similar to this

Source Target

Dept,sal Count
10,100 100
10,110 210
20,200 200
20,210 410

How to perform this.

Thanks

Posted: Wed Sep 04, 2013 11:05 am
by prasson_ibm
Hi,

Iit seems to be a interview question.
Please tell us that what you have attempted so far.

Posted: Wed Sep 04, 2013 11:15 am
by Prince_Hyd
Hello Parsson

I took one stagevar for deptno and given logic like this

StageVar = deptno

If deptno = StageVar Then S1+Sal Else Sal --------------- S1

but i'm not getting the expected result


Thanks

Posted: Wed Sep 04, 2013 1:14 pm
by asorrell
I believe what you need are two stage variables:

1) svCount = If (incominglink.Dept = svDept) Then (svCount + incominglink.Sal) Else incominglink.Sal
2) svDept = incominglink.Dept


They must be in that order. svDept should be initialized to "".

Posted: Wed Sep 04, 2013 11:05 pm
by Prince_Hyd
Hello Andy

Thanks for your solution, it worked perfectly!