Grand sum in calc subtotals always also shows last line

Libreoffice version 24.2.0.3

I have a simple list of 2 columns and 11 rows including the header row.

cat amt
a 1,00
a 7,00
a 13,00
a 19,00
b 2,00
b 8,00
b 14,00
b 20,00
c 3,00
c 9,00

When I create subtotals it gives a perfect overview:

cat	amt
a	1,00
a	7,00
a	13,00
a	19,00
a Sum	40
b	2,00
b	8,00
b	14,00
b	20,00
b Sum	44
c	3,00
c	9,00
c Sum	12
Grand Sum	96

When I close the 2nd level then I see a perfect overview of the ‘sums’:

cat	amt
a Sum	40
b Sum	44
c Sum	12
Grand Sum	96

But when I close the 1st level because I only want to seen the Grand Sum then it also always shows the last line:

cat	amt
c Sum	12
Grand Sum	96

How Can I prevent this?

Please attach a sample file by using the 7th icon on the toolbar just above the reply box.

test.ods (16.7 KB)

You need to extend group 1 until row 24.
testnew.ods (17.2 KB)

Nice! I see that it works in your file, but how do I extend group1?

What i did was ungroup and group again.

Thank you! It works!