[Solved] How to calculate with a calculated field?

Getting your data onto paper - or the web - Discussing the reports features of Base

[Solved] How to calculate with a calculated field?

Postby lachass » Wed Feb 11, 2015 4:56 pm

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 70 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
lachass
 
Posts: 16
Joined: Wed Jan 28, 2015 5:02 pm

Re: How to calculate with a calculated field?

Postby chrisb » Wed Feb 11, 2015 8:40 pm

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   Expand viewCollapse view
([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.6 & LibreOffice 6.0.7.3 (x64) using HSQL 1.8.10 (Embedded) and HSQL 2.4.1 (Split) on Windows 10
chrisb
 
Posts: 177
Joined: Mon Jun 07, 2010 4:16 pm

Re: How to calculate with a calculated field?

Postby lachass » Thu Feb 12, 2015 4:58 pm

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
lachass
 
Posts: 16
Joined: Wed Jan 28, 2015 5:02 pm


Return to Reporting

Who is online

Users browsing this forum: No registered users and 1 guest