Bug 97513 - In Pivot tables, compute sum for numbers and counts for other formats by default
Summary: In Pivot tables, compute sum for numbers and counts for other formats by default
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Pivot-Table
  Show dependency treegraph
 
Reported: 2016-02-02 17:11 UTC by Milan Bouchet-Valat
Modified: 2021-05-03 14:54 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Milan Bouchet-Valat 2016-02-02 17:11:34 UTC
When creating a Pivot table (Data->Pivot Table->Create) and adding a variable (column) in Data Fields, Calc always computes the sum of values. This doesn't make sense for columns which do not contain numbers, in which case the result is empty. MS Excel retains a more natural behavior in that case: it automatically chooses to compute the counts (of unique values) instead. In Calc, one has to do so manually by double-clicking on the variable.

This would be particularly useful when the variable is an observation identifier, which is a very common scenario (e.g. results from surveys, clients database...).
Comment 1 raal 2016-02-03 13:39:56 UTC
Valid enhancement.
Comment 2 Milan Bouchet-Valat 2016-02-05 10:27:19 UTC
Let's see what the UX team thinks.
Comment 3 Heiko Tietze 2016-02-05 10:34:59 UTC
Sounds reasonable. First step in an analysis should always be the checking of raw data, here the count of valid numbers, followed by the computation of descriptive or summative information afterwards.
Comment 4 Milan Bouchet-Valat 2016-02-05 16:19:13 UTC
(In reply to Heiko Tietze from comment #3)
> Sounds reasonable. First step in an analysis should always be the checking
> of raw data, here the count of valid numbers, followed by the computation of
> descriptive or summative information afterwards.

I'm not sure I understand what you mean here. My proposal concerns only columns which contain non-numeric values, for which no summation can be done.
Comment 5 Heiko Tietze 2016-02-08 08:07:20 UTC
I was looking for a reason to change it in general. The more variants we have in the program, like ifthen sum or count, the harder is it for users to figure out why things happens - and the complexity of the code increases.

So the question is why not always (row/col, with/without NAN) calculate the number of values?
Comment 6 raal 2016-02-08 08:14:26 UTC
(In reply to Heiko Tietze from comment #5)

> So the question is why not always (row/col, with/without NAN) calculate the
> number of values?

Because when you change the default (from SUM to COUNT), users will be angry. When you do what Milan suggested, it's clear enhancement. btw. that's the behaviour how Excel works.
Comment 7 Milan Bouchet-Valat 2016-02-08 13:10:57 UTC
That's right. Another point is that users already have to take into account different behaviors depending on whether the values are numeric or not: sum produces an empty result when applied to non-numeric values.
Comment 8 Robinson Tryon (qubit) 2016-08-25 05:38:53 UTC Comment hidden (obsolete)
Comment 9 Jaka 2018-09-02 16:51:24 UTC
Just agreeing and noting that the wish to have unique counting as an option is tracked here: https://bugs.documentfoundation.org/show_bug.cgi?id=90665

I wouldn't say it's a dependency though, since even defaulting to the normal count for non-numeric fields would be welcome.
Comment 10 kaesezeh 2019-06-22 16:50:47 UTC
I'd just like to second this, this is a wish I had for YEARS, summing for variables with numerics in them and counting unique values for anything else makes just so much more sense and will save users countless clicks. It would be great if this could be done ...