[Solved] How to calculate with a calculated field?

Getting your data onto paper - or the web - Discussing the reports features of Base
Post Reply
lachass
Posts: 16
Joined: Wed Jan 28, 2015 5:02 pm

[Solved] How to calculate with a calculated field?

Post by lachass »

Hello,

I'm trying to make an invoice for a camping with the Report builder. I have calculated two subtotals by accumulation in the report (one for the total amount and one for the TVA).
But now I need to multiply these subtotals with the number of nights people stayed (nombre de nuits).
And when people have already paid an advance that needs to be subtracted to get the real amount that people need to pay in the end.
How can I do those two things?

I have attached the database 'lachass' for anyone to check it out. The labels are in French.
Attachments
lachass.odb
(70.37 KiB) Downloaded 285 times
Last edited by lachass on Thu Feb 12, 2015 4:59 pm, edited 1 time in total.
OpenOffice 4.0.0 on windows 8.1
chrisb
Posts: 298
Joined: Mon Jun 07, 2010 4:16 pm

Re: How to calculate with a calculated field?

Post by chrisb »

Hello lachass,

your aim I believe is :- (total+TVA 10%)*number of days-advance.

this is very easy to achieve when using report builder.

using your data your formula is:-

Code: Select all

([Accumulationsubtotaal TVA (10%)Report]+[AccumulationsubtotaalReport])*[aantal nachten]-[aanbetaling]
1. copy the formula.
2. drag out a text box in your footer.
3. if necessary hit (F4) to view the properties.
4. select 'General' tab then hit formatting & format to 2 decimal places.
5. select 'Data' tab.
6. 'Data Field Type' = 'Field or Formula'
7. 'Data field'= paste your formula here & hit enter.
8. execute report.
open office 4.1.14 & LibreOffice 6.4.4.2 x64 using HSQL 1.8.0.10 (Embedded) and HSQL 2.6.0 (Split) on Windows 10
lachass
Posts: 16
Joined: Wed Jan 28, 2015 5:02 pm

Re: How to calculate with a calculated field?

Post by lachass »

Hello Chrisb,

Thank you very much. It worked like a charm.
I didn't need the formula as you wrote, but the setup was clear so I could adapt it to my needs.

Cheers,
Lachass
OpenOffice 4.0.0 on windows 8.1
Post Reply