@markamathews,
we do not know which database you use.
libreoffice comes with 2 databases hsqldb 1.0.x embedded and firebird 3.x embedded neither of which contain the ROUNDUP function.
.
Wanderer suggested a solution 12 days ago, did you try it? what was the result?
.
UNION is the way to go.
- open your db.
- hit Queries icon.
- hit Create Query in SQL View.
- paste the sql code.
- select direct mode (see pic).
- hit F5 to execute.
.
caveats:
the total amount needs to be the final record shown therefore I have added the field “Level”.
UNION requires direct mode i.e. menu:>Edit>Run SQL command directly (see image)
EDIT 2024-04-17
just remembered that when using embedded hsqldb ORDER BY clause can only be used once and must be last line of code. sql is now updated.
select
"Item",
"Amount"
from
(
select
1 "Level",
"Item",
sum("Amount") as "Amount"
from
"Counting"
where
"Date" = '2024-02-26'
group by
"Level",
"Item"
union all
select
2,
'**Total**',
sum("Amount")
from
"Counting"
where
"Date" = '2024-02-26'
) a
order by "Level", "Item"