# Re: Generating an index, but forcing it to start at a particular point

3 messages
Open this post in threaded view
|
Report Content as Inappropriate

## Re: Generating an index, but forcing it to start at a particular point

 Dear all, To generate an index count from 1 to whatever one can use: Compute index = \$casenum. But what if I want to start at say -20 to -2? Any ideas? Sibusiso.
Open this post in threaded view
|
Report Content as Inappropriate

## Re: Generating an index,

 At 11:44 AM 6/16/2006, Sibusiso Moyo wrote: >To generate an index count from 1 to whatever one can use: > >Compute index = \$casenum. > >But what if I want to start at say -20 to -2? There's always simple addition: COMPUTE INDEX  = \$casenum - 21. If you want your first index value to be #START, say -20, and your increment to be #BY, say -2, you can write COMPUTE #START = -20. COMPUTE #BY    = -2. COMPUTE INDEX = #START + #BY(\$CASENUM-1). However, since this IS simple, I'm probably misunderstanding you ...