Subscribe Bookmark RSS Feed

Re: Formula for Number of Unique Categories in Column

martinkane

Community Trekker

Joined:

Aug 13, 2013

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
Highlighted
txnelson

Super User

Joined:

Jun 22, 2012

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
martinkane

Community Trekker

Joined:

Aug 13, 2013

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

Highlighted
txnelson

Super User

Joined:

Jun 22, 2012

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
martinkane

Community Trekker

Joined:

Aug 13, 2013

This is PERFECT! Thank you Jim!