Already two geniuses have given answered to your post. Here is another approach using windows table calculation
Compute using Table (across)
Hope this will help.
cpc greater_v10.2.twbx 18.6 KB
Thanks Deepak Rai Shinichiro Murakami Mahfooj Khan for the useful tips and it seems to be working. However, when I'm working on the original dataset there are some odd examples that do not fit the rule. I'll circle back with those examples. Hope you can shed some light on how to fix those.
And Shinichiro Murakami - thanks so much for the step by step. It really helped a novice like me learn more out LODs.
You are welcome.
Could you please mark either of answer as correct as forum guideline (You need to pick one as correct).