Bug 123727 - PIVOTTABLE Allow use of text columns as Data Fields
Summary: PIVOTTABLE Allow use of text columns as Data Fields
Status: RESOLVED INSUFFICIENTDATA
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.0.1.1 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsUXEval
Depends on:
Blocks: Pivot-Table
  Show dependency treegraph
 
Reported: 2019-02-26 22:15 UTC by Donaithnen
Modified: 2022-07-08 07:29 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Example of desired Pivot Table behaviour (9.78 KB, application/vnd.oasis.opendocument.spreadsheet)
2019-05-09 22:50 UTC, Donaithnen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Donaithnen 2019-02-26 22:15:59 UTC
Description:
Per the question asked here: https://ask.libreoffice.org/en/question/86251/how-do-you-reference-text-in-a-pivot-table-data-field/

As of 6.0 there's still no way to create a pivot table using columns with text as Data Fields because all text values are ignored. If the text columns are added as Row Fields the text is carried over into the pivot table but rows with the same ID aren't combined.


Steps to Reproduce:
1.Create two sets of data with the same ID column and some shared IDs, but have one set of text columns for the first block of data and another set of columns for the second set of data.
2.Create a pivot table using the combined data.
3.Make the ID column a Row Field. If the text columns are included as Data Fields the values disappear. If they're included as Row Fields they're not combined.

Example
ID	Col1	Col2	Col3	Col4	Col5
1	Data 1 - 1	Data 2 - 1	Data 3 - 1		
1				Data 4 - 1	Data 5 - 1


Actual Results:
Text as Data Fields

ID	Count - Col1	Max - Col2	Product - Col3	Max - Col4	Var - Col5
1					

Text as Row Fields

ID	Col1	Col2	Col3	Col4	Col5	(empty)
1	Data 1 - 1	Data 2 - 1	Data 3 - 1	(empty)	(empty)	
	(empty)	(empty)	(empty)	Data 4 - 1	Data 5 - 1	



Expected Results:
ID	Col1	Col2	Col3	Col4	Col5
1	Data 1 - 1	Data 2 - 1	Data 3 - 1	Data 4 - 1	Data 5 - 1



Reproducible: Always


User Profile Reset: No



Additional Info:
The best way to address it would be either to have the Max or Min Data Field functions work on text, or to add a new Data Field function "Text" or "First" that would pick the first text field encountered for that column.
Comment 1 Roman Kuznetsov 2019-05-09 17:12:51 UTC
please attach sample with source data on Sheet 1 and what do you want to see on Sheet 2
Comment 2 Donaithnen 2019-05-09 22:50:07 UTC
Created attachment 151277 [details]
Example of desired Pivot Table behaviour

Here's an expanded version of the example given in the original description.
Comment 3 QA Administrators 2019-05-14 03:02:17 UTC Comment hidden (obsolete)
Comment 4 Heiko Tietze 2022-04-06 08:18:20 UTC
I'm still having trouble to follow the use case.

Using something like
<Col A> <Col B>
One  =rand()
One  =rand()
One  =rand()
Two  =rand()
Two  =rand()
Two  =rand()
etc.

works nicely with colA as category in the pivot table. And I cannot wrap my mind around text as data field: What is the sum of colA?

The request on ask.libreoffice looks rather as if you try to merge two datasets. There are other methods.
Comment 5 Heiko Tietze 2022-07-08 07:29:58 UTC
Please reopen with more details.