Hi All,
Need help in implementing the following logic
I have three files as shown in the below given format
File1
ID IND
1 Y
File2
ID IND
1 Y
1 X
1 A
1 X
File3
ID IND
1 Y
1 Z
All the above 3 files are the reference files and the input file or the main file will look like
Main File
ID IND1 IND2 IND3
1 - - -
The output should be like
ID IND1 IND2 IND3
1 Y X A
IND1 = Y since it found match in first file
IND2 = X (Since it has more occurances than A)
IND3 = A (Since it is the next most dominant in the second file)
We will pull the indicator value from third file only when we dont find any match from 1st and 2nd file.
Thanks in Advance
Join logic
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
That must be straight-forward. What have you tried so far ?
Please post your attempts so others can guide you rather than asking others to 'do it for you'.
Anyhow, one method will be
1.) Get ind1 from your reference 1
2.) Aggregate the values in your files and sort by desc id and count.
3.) Take first two rows for ind 2 and ind 3.
I will leave this logic to your imagination.
Please post your attempts so others can guide you rather than asking others to 'do it for you'.
Anyhow, one method will be
1.) Get ind1 from your reference 1
2.) Aggregate the values in your files and sort by desc id and count.
3.) Take first two rows for ind 2 and ind 3.
I will leave this logic to your imagination.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Waiting for question to be posted in Parallel forum.
If I were to answer the question here, my answer would pertain to server jobs and waste both your time and mine.
If I were to answer the question here, my answer would pertain to server jobs and waste both your time and mine.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.