cancel
Showing results for 
Search instead for 
Did you mean: 

Consolidating consecutive numbers!

Former Member
0 Kudos

Hi!

I have an internal table with 2 fields.

For e.g.

A | B

2152 | 2177

2246 | 2259

2260 | 2299

2300 | 2329

2330 | 2337

2338 | 2345

2346 | 2350

2397 | 2407

I would need the output as

2152 - 2177

2246 - 2350

2397 - 2407.

The numbers from B to the immediate next row of A has to be consecutive; if not it forms the next sequence - till it is not consecutive.

Any help would be appreciated. Points would be rewarded for any help rendered! Thanks!

Regards,

Jonathan.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

I need the output in the form A - B.

A | B

2152 | 2177

2246 | 2259

2260 | 2299

2300 | 2329

2330 | 2337

2338 | 2345

2346 | 2350

2397 | 2407

In the second row 2246 is not the consecutive number of 2177. So the first sequence is 2152 - 2177. The following rows are in sequence upto the second last row. So the sequence is 2246 - 2350. And the last sequence is 2397 - 2407. Hope its helpful!

Regards,

Jonathan.

Former Member
0 Kudos

Hi,

Clearly explain your requirement.

Regards,

Azaz Ali.