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

- 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
(1407 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
(2694 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
(1405 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
(2695 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
(1291 views)