Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have data like the following:
Table1:
Id | Seg |
1 | 260 |
1 | 144 |
1 | 555 |
2 | 628 |
2 | 953 |
2 | 876 |
2 | 212 |
3 | 142 |
3 | 523 |
4 | 189 |
4 | 634 |
4 | 988 |
4 | 755 |
I need to achieve the following result (in the script):
Table2:
Id | Final Seg |
1 | 144 |
2 | 953 |
3 | 142 |
4 | 988 |
Where "Final Seg" =
for each Id
if one of the values (Seg) is in the interval [140 - 146] then
finalSeg = Seg
else // no Seg value in the interval
finalSeg = the max Seg value (for this Id)
end
end
Thanks.
Hi,
Please find the attached application as per your requirment.
Regards,
Sridhar Chitikela