Bug 96977 - PIVOTTABLE FORMATTING: pivot table uses the formatted column label which cause errors when calling GETPIVOTDATA
Summary: PIVOTTABLE FORMATTING: pivot table uses the formatted column label which caus...
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.0.4.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Pivot-Table
  Show dependency treegraph
 
Reported: 2016-01-09 00:28 UTC by julien
Modified: 2019-12-06 01:52 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Test-case and comparison with WPS Office and MS Office (148.79 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2016-01-09 00:28 UTC, julien
Details

Note You need to log in before you can comment on or make changes to this bug.
Description julien 2016-01-09 00:28:30 UTC
Created attachment 121810 [details]
Test-case and comparison with WPS Office and MS Office

Context:
Format Accounting imported from Excel produces a space prefix and suffix (e.g. "sales" => " sales ").
This is probably the expected behavior as the space prefix is clearly visible in LibreOffice 10, Excel 2010 and WPC Office 2016 Beta.
Moreover, when the cell is copied into text format (e.g. in Windows Notepad), the value with spaces is copied.

The LibreOffice Pivot table uses the formatted content converted to text (" sales ") instead of the value itself ("sales"). This is clearly visible in the Pivot table layout (see attached file).
The consequence is that formulas such as '=GETPIVOTDATA("sales",A1)' returns "#REF!" because "sales" is not found (but '=GETPIVOTDATA(" sales ",A1)' work as expected)

In Microsoft Excel 2013 and WPS Office 2016 Beta, the Pivot table is using the original value and not the formatted content. Thus '=GETPIVOTDATA("sales",A1)' returns the expected content.

Expected result:
PIVOT TABLE uses the raw column labels.

Actual result:
PIVOT TABLE uses the formatted column label.

Test-case to reproduce the issue:
See the attached file.

Potential similar issues:
https://bugs.freedesktop.org/show_bug.cgi?id=73305
https://bugs.documentfoundation.org/show_bug.cgi?id=70275
https://bugs.documentfoundation.org/show_bug.cgi?id=89186
Comment 1 m_a_riosv 2016-01-09 20:30:48 UTC
Reproducible.
Win10x64
Version: 5.0.4.2 (x64) Build ID: 2b9802c1994aa0b7dc6079e128979269cf95bc78
Comment 2 QA Administrators 2017-03-06 13:53:43 UTC Comment hidden (obsolete)
Comment 3 QA Administrators 2019-12-03 14:54:54 UTC Comment hidden (obsolete)
Comment 4 m_a_riosv 2019-12-06 01:52:01 UTC
Works for me.
Version: 6.5.0.0.alpha0+ (x64)
Build ID: 60e8941fd581bb06cbf6be62edb8c387e7c07812
CPU threads: 4; OS: Windows 10.0 Build 19035; UI render: default; VCL: win; 
Locale: es-ES (es_ES); UI-Language: en-US
Calc: CL