Pages

Sunday, March 17, 2013

Calculate the contribution to family income

I/P:
Family ID
Person ID
Person Name
Earning
100
1
Vijay
20000
100
2
Ajay
30000
200
3
Bharat
60000
200
4
Akash
60000
300
5
Sanjay
50000

 O/P:
Family ID
Person ID
Person Name
%Contribution to family
100
1
Vijay
40
100
2
Ajay
60
200
3
Bharat
50
200
4
Akash
50
300
5
Sanjay
100
Solution: 
This can be done this the help of Joiner and Aggregator.
Port
Expression
Group by
Family_id1

Yes
Sal


Tot_sal
Sum(sal)

 
Use the joiner to join the records based on the family id 
Port
Master/Detail
Family_id
Detail
Tot_Sal
Detail
Person_id
Master
Family_id
Master
Person_name
Master
Sal
Master
 Use the Join condtion
Family_id1=family_id
Use the expression to get the calculation
Port
Epression
Contribution
(sal/Tot_sal)*100

No comments:

Post a Comment