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
- :
- Formula for Number of Unique Categories in Column

Topic Options

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

Highlighted

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

Apr 19, 2017 1:53 PM
(1758 views)

I am looking for the column formula to provide me with the count of unique categories in a column (maybe based on another columns categories). For instance, if a column has

A

A

B

B

B

C

then I would like to get back the value 3.

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

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

Apr 19, 2017 2:08 PM
(3396 views)

Solution

Try this formula.......of course, swap out the :Flow for the column you want to count the categories for

```
Summarize( x = by( :FLOW ) );
N Items( x );
```

If the data table is really large, you may want to use this more efficient version

```
If( Row() == 1,
Summarize( x = by( :Flow ) );
y = N Items( x );
);
y;
```

Jim

3 REPLIES

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

Apr 19, 2017 1:55 PM
(1756 views)

I think I remember the Summation formula being used for this, but my memory fails me.

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

Apr 19, 2017 2:08 PM
(3397 views)

Try this formula.......of course, swap out the :Flow for the column you want to count the categories for

```
Summarize( x = by( :FLOW ) );
N Items( x );
```

If the data table is really large, you may want to use this more efficient version

```
If( Row() == 1,
Summarize( x = by( :Flow ) );
y = N Items( x );
);
y;
```

Jim

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

Apr 25, 2017 11:01 AM
(1642 views)