Ask Your Question

How to group sorted rows in PivotTables?

asked 2017-01-25 05:36:28 +0200

Khashir gravatar image

updated 2017-01-25 05:40:59 +0200

I have a pivot table summarizing numeric values per country (say, kilos of pasta consumed per year), sorted in descending order by amount consumed. For reasons, 4 countries represent over 90% of the total consumed, so that the remaining 10% is distributed across the rest in negligible amounts.

In Excel, I was able to Group those other countries into their own category ("Others"), aggregating their consumption, yielding cleaner tables and graphs (my table/graph now had 6 data rows, instead of 20-- one for each of the 4 big countries, the "Others," and the Total), making the whole thing easier to read.

When I try to do the same in LibreOffice, countries get grouped in alphabetical order (the default order, rather than by volume, the sort order I set), creating a useless mess: I have the Others category, but it doesn't contain the right countries.

In theory, I could do it manually, by adding a column Country2, and using VLOOKUP to flag as Others the smaller countries. But that seems overkill: there should be a way to do it automatically.

Is this a bug?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2017-01-25 09:59:25 +0200

pierre-yves samyn gravatar image

updated 2017-01-25 10:26:25 +0200


  • Select countries to be grouped: screenshot
  • DataGroup and OutlineGroup (or F12), you get this: screenshot
  • DataGroup and OutlineHide details

You can sort as you like this way:

image description

See Group.ods


edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-01-25 05:36:28 +0200

Seen: 340 times

Last updated: Jan 25 '17