gristlabs / grist-core

Grist is the evolution of spreadsheets.
https://www.getgrist.com/
Apache License 2.0
7.09k stars 315 forks source link

Show unique values in footer summary #358

Open yohanboniface opened 1 year ago

yohanboniface commented 1 year ago

Hi,

The footer summary (with count, number of lines…) is very useful, thanks! I've a suggestion: we often need to count the unique values of a column, could this count be added in the summary ?

Something like this:

image

What do you think ? :)

anaisconce commented 1 year ago

Interesting! Is this for particular column types? Text/Choice, for example?

Btw, you can do this somewhat quickly now by peeking at the filter menu. The value inline on the right is the count of that unique value. I right-click on the column and click on "Filter Data" from the context menu.

image

yohanboniface commented 1 year ago

Ah, I've not been clear!

I don't want to have the count of a given value, but the count of how many unique values there are in a selection. Eg. here unique would be 3 (A, B, and C):

image

Does that make sense ? :)

anaisconce commented 1 year ago

Ahhh, that makes sense! I wonder how universal this desire is?

Seeing this request, it makes me itch for a way to add a custom formula that applies over a selection, and the ability to save that as a quick shortcut that appears in the footer of widgets beside sum and/or count as you have mocked up. This begins to scratch the itch to apply formulas over a range in the way that can be done in spreadsheets. In some cases, it's more convenient than formula columns.

paulfitz commented 1 year ago

A count of distinct values does seem a useful feature, and I think I've heard it asked for before. As more is added to the footer, we'd need to be more careful to fold things up nicely if there isn't much horizontal space available, but that seems doable.

Custom formulas would be neat. For our current architecture, I think it would tip the feature over into needing back-end support to process the formulas.