Erik Borghouts

Erik Borghouts

  • NA
  • 11
  • 32.7k

Renumbering positions in hierarchy,

Sep 27 2010 3:16 PM

Below is a list array.
Always start on level 1.
Positions have to be numbered, increments are 10. Starting with 10.
When there is a change from level 1 to 2, position must start with 10 again.
Same for change from level 2 to 3 and so on.
When go back from level 2 to 1, numbering has to start with increment 10 on the previous position from level 1
Is there a suggestion (I can renumber, when the level changed back it want remmeber the position)
 
Level|Position|ItemGroup|I
1    |        |PCBFLX   |401246900|
1    |        |CASCER   |402984000|
1    |        |CASCER   |402961200|
1    |        |MPCAH    |401617802|
2    |        |CASCER   |400094000|
2    |        |CASCER   |402961600|
2    |        |CASCER   |402961000|
2    |        |CASCER   |402965000|
2    |        |CASCER   |402965100|
2    |        |CASCER   |402976900|
2    |        |CASCER   |402965200|
2    |        |DISDIO   |400568400|
1    |        |CASCER   |402961200|
1    |        |CASCER   |402961200|
2    |        |CASCER   |402965200|
3    |        |CASCER   |402965200|
3    |        |CASCER   |402965200|
1    |        |CASCER   |402965200|
 
Result should be:
Level|Position|ItemGroup|I
1    |   10   |PCBFLX   |401246900|' Start 10, first item in array lev1
1    |   20   |CASCER   |402984000|' +10
1    |   30   |CASCER   |402961200|' +10
1    |   40   |MPCAH    |401617802|' +10
2    |   10   |CASCER   |400094000|' Start 10, items belong to previous
2    |   20   |CASCER   |402961600|' +10
2    |   30   |CASCER   |402961000|' +10
2    |   40   |CASCER   |402965000|' +10
2    |   50   |CASCER   |402965100|' +10
2    |   60   |CASCER   |402976900|' +10
2    |   70   |CASCER   |402965200|' +10
2    |   80   |DISDIO   |400568400|' +10
1    |   50   |CASCER   |402961200|' See level 1, pos. 40 '+10
1    |   60   |CASCER   |402961200|' +10
2    |   10   |CASCER   |402965200|' Start 10,items belong to previous
2    |   20   |CASCER   |402965200|' +10
3    |   10   |CASCER   |402965200|' Start 10, items belong to previous
3    |   20   |CASCER   |402965200|' +10
1    |   70   |CASCER   |402965200|' See level 1, pos. 60 '+10

Answers (4)