Plan ID Commision
1111 20
1111 -10
2222 10
2222 -5
2222 -10
The requirement is such that -> i want to exclude the records, if the total for the Commision amounts grouped on the Plan ID is coming negative.
In the above example the expected output is :
1111 20
1111 -10
Records for 2222 will be excluded since the sum of commisions for PlanID 2222 is coming to be -5 (negative value)
As far as i know if the requirement would have been to get single records, we could have used the "sum fields".
Please help me with this scenario.
Thinking over this problem, i could come up with the following logic:
1. Sum the records and extract the records with negative values in a file.
2. Now using the file created in first step, exclude the records from the original file (the input for the 1st step) if they exist in the first file.
the challenge i forsee in this step is that there are duplicate records in the original file from which i have to extract records.
Thanks for your response, the solution is working perfectly. Since i am not aware of the fields you have used, i would request you to please tailor the above solution for the below:
Can you please modify this for a file having a FB of 503
and the field to be summed up is at position 216 (Lenght 10) -- ZD (I beileve Binary - usage is comp is ZD).
And also the output should be in the same sequence as the input.