Count unique Items in a list

Hello Team,

i would like to prepare a list with unique items and their count by number of times of repeatation.

For example:

Apple

Apple

Apple

Guava

Guava

Mango

Mango

Mango

 

 

i want to create an expression that gives me the list of number of times unique item is appearing

like this:

Apple - 3

Guava - 2

Mango - 3

 

Hope someone helps. Thanks!

0 5 188
5 REPLIES 5

Are these rows in a table or a single enum list within one column within one row?

These are rows in a table with Columns UniqueID and Fruit Name.

i tried alot to create an expression to count unique items using select, filter and unique.. but havent got any result uptill now.

What is your backend data source (Google Sheets, SQL,etc.)?

The easiest way to visualize that in appsheet is going to be to create a table view of your fruit table. Add the Fruit Name to the Group by view attribute as shown in the image below. Select the COUNT option in the Group aggregate view attribute.

Landan_QREW_0-1701879668754.png

 

Yes. My backend data source is google sheets. But i am not creating it as a view, instead i am passing the data through whatsapp api external link hence need an expression to calculate the same. i am still not able to get this data through an expression, i tried alot. in google sheets its simple to get using countunique function, but my data is already so much stacked and complicated that i dont want to add another column for counting unique. hence need an expression. Thanks!

You are not going to be able to write a sufficient expression in AppSheet that could account for a theoretically infinite number of rows in your fruit table.

I would recommend using a SQL backend where you can have a grouped view of your table or to use the QUERY function in Sheets to generate a grouped view of your fruit table.

Top Labels in this Space