Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Discussions
- :
- Re: Counting...

Topic Options

- Start Article
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Apr 11, 2019 5:05 AM
(167 views)

So I have a column like this (it is character) and I would like to create a way to add a countup of the times it occurs. The data will be sorted by another column which is test date/time so that I can later see if the 1st or 2nd or 3rd etc...time in the Aliquot are different than the 4th or 5 etc....so how to count sequentially based on the AliquotID

AliquotID New Column

11172 1

11172 2

11172 3

11172 4

11172 5

11172 6

11173 1

11173 2

11173 3

11173 4

11173 5

11173 6

11174 1

11174 2

11174 3

11174

11174

11174

11175

11175

11175

11175

11175

11175

11176

11176

11176

11176

11176

11176

1 ACCEPTED SOLUTION

Accepted Solutions

Highlighted
Solution

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

try this formula

```
If( Lag( :AliquotID ) != :AliquotID,
x = 1,
x = x + 1
);
x;
```

Jim

4 REPLIES 4

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Counting...

Sort by AliquotID and Date. Then run this script:

```
Current Data Table() << New Column( "Replicate", "Numeric", "Ordinal",
Formula( If( Row() == 1, 1, :AliquotID == Lag( :AliquotID ), Lag( :Replicate ), Lag( :Replicate ) + 1 )
);
```

Learn it once, use it forever!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Counting...

This kind of question has been asked and solved before.

Learn it once, use it forever!

Highlighted
Solution

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

try this formula

```
If( Lag( :AliquotID ) != :AliquotID,
x = 1,
x = x + 1
);
x;
```

Jim

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Counting...

Thank you so much!