Sequential numbering

Is there an object or method for creating a column of sequential numbers?

I’ve tried enumerate and rank object, however these objects depends on the other columns being sort. What i’m after is independently assigning number 1 to X down the column.

The Enumerate object is the method of choice for generating an index column. If you want a random assignment you can generate a column with a random number using Data Wizard and a Custom Transformation like rand(0,1,ID). Then you can use this random column for enumeration.

Thank you for your reply. Unfortunately the rand function generated the same random number within every cell of the same column.

You can use any numerical column to give the random number a different seed, i.e. the third argument of the rand() function. Would that help?

CTUK - can you perhaps post a CSV or PHXPROJ illustrating exactly what it is you want to do?

Is it you want one sequence to continue over all profiles or what? Enumerate can use user values and data transformations are normally quite flexible.

thanks. SImon.

Hi Simon,I have attached a table of what I’m looking to achieve. I would like to create a a column (labelled as sequence below), with numbers increasing in ascending order.

Time Conc Sequence 0 0 1 1 20 2 2 80 3 4 200 4 8 160 5 12 80 6 24 40 7

I have attached a photo instead

I think the attached example using enumerate covers a couple of options that you want to do, resetting the sequence within profile or not.

Please take a look at this and let us know if there is something missing.

Simon.

enumerate_v7.phxproj (353 KB)

Hi Simon

Thank you very much for providing the example. It is very useful. I can see from the first workflow that it’s just a matter of creating a unique combination of each row in order to enumerate a unique number each time.

For the attached file, I’ve also added an extra column to the data “Occasion” with the same subject and timepoints. The enumerate method works if the Occasion column is included for sorting as well.