[Solved] Pivot Table

Discuss the spreadsheet application
Locked
dreamquartz
Posts: 921
Joined: Mon May 30, 2011 4:02 am

[Solved] Pivot Table

Post by dreamquartz »

Hi All,

Have been fighting to set up a Pivot Table for a while, but with little luck.

I have a Query, leading to City and the Postal Codes in that City.
Need to determine the how many PC's there are in a City, how many are actually entered, and what the percentage if of the PC in relation to the City.

Attached I added a simple Calc Sheet to provide an example.

Hope someone can give some insight.

Dream
Attachments
PivotExample.ods
(15.52 KiB) Downloaded 228 times
LO 7.x, HSQLDB 2.7.x & Ubuntu 24.04 LTS.
jrkrideau
Volunteer
Posts: 3816
Joined: Sun Dec 30, 2007 10:00 pm
Location: Kingston Ontario Canada

Re: [SOLVED] Pivot Table

Post by jrkrideau »

How? I was just going to say I didn't think a pivot table was flexible enough.
LibreOffice 7.3.7. 2; Ubuntu 22.04
dreamquartz
Posts: 921
Joined: Mon May 30, 2011 4:02 am

Re: [SOLVED] Pivot Table

Post by dreamquartz »

jrkrideau wrote:How? I was just going to say I didn't think a pivot table was flexible enough.
Please see the moved question to the Base Forum for follow up.
Because it is moved, it has been marked as [SOLVED] here.

Dream
LO 7.x, HSQLDB 2.7.x & Ubuntu 24.04 LTS.
User avatar
Villeroy
Volunteer
Posts: 31365
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [SOLVED] Pivot Table

Post by Villeroy »

There seems to be a bug. I append a calculated field =ISBLANK($C2) to the source table and add it to the pivot table as a column field. It shows the count of FALSE values only (not blank). It never shows any results for the TRUE category (blank). Same with a calculated text field =IF(ISBLANK(C2);"Yes";"No").
Filed issue: https://bz.apache.org/ooo/show_bug.cgi?id=126718
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
dreamquartz
Posts: 921
Joined: Mon May 30, 2011 4:02 am

Re: [SOLVED] Pivot Table

Post by dreamquartz »

Villeroy wrote:There seems to be a bug. I append a calculated field =ISBLANK($C2) to the source table and add it to the pivot table as a column field. It shows the count of FALSE values only (not blank). It never shows any results for the TRUE category (blank). Same with a calculated text field =IF(ISBLANK(C2);"Yes";"No").
Filed issue: https://bz.apache.org/ooo/show_bug.cgi?id=126718
I closed this under Calc and moved it to the Base forum.
I am looking for a solution, where NOT having to copy the result set of the Base Query into Calc, and then use the Pivot Table, but simply use the Pivot Table with the Query as a source. Have no problem tweaking any Query :D :D .

Dream.
LO 7.x, HSQLDB 2.7.x & Ubuntu 24.04 LTS.
jrkrideau
Volunteer
Posts: 3816
Joined: Sun Dec 30, 2007 10:00 pm
Location: Kingston Ontario Canada

Re: [SOLVED] Pivot Table

Post by jrkrideau »

Ah yes, BASE sounds like not a bad idea. Otherwise I suspect it is fairly easy in Python or [url=http://www.-project.org/]R[/url] but it did not look like an obvious Pivot Table problem
LibreOffice 7.3.7. 2; Ubuntu 22.04
User avatar
Villeroy
Volunteer
Posts: 31365
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Solved] Pivot Table

Post by Villeroy »

Congratulations for your decision to work with Base. Nevertheless, pivot tables can serve as an excellent reporting tool for database records as well.

My filed issue about pivot tables is invalid. I had chosen the wrong data field.
For the records I'll attach a solution with a pivot that comes quite close to the wanted result.

Another tip: With MRI as a "helper GUI" it is possible to rename existing pivot field labels. Navigate to the right DataPilotTable on the right sheet, then choose the right field from the collection of DataFields, ColumnFields or RowFields, switch from Get mode to Set mode and call method setName(). This seems to not actually rename the field (getName() returns the same as before) but the label changes anyway.
Attachments
dreamquartz_pivot.ods
(18.37 KiB) Downloaded 231 times
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Locked