Ask Your Question
0

How may I do a calculated field in Base without a query? [closed]

asked 2013-08-03 00:40:38 +0100

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hello I would like to know if may I do a calculated field in Base, without a query. Sometimes, you won't have to deal with queries, because you want an immediate reply for a simple calculated query. Let's imagine I have a table, with several fields... and I have a field called... AMOUNT and another field called DISCOUNT finally, another field called RESULT this field (RESULT) would deduce the porcentaje of discount entered in the discount field, so the formula to calculate this field (RESULT) would be: RESULT = AMOUNT - (( AMOUNT * DISCOUNT ) / 100) That is in plain words, I multiply the amount per the discount, then I divide it by 100, and then, I deduce this result from the AMOUNT. if I enter $100 in the AMOUNT field, and I enter 20 in the DISCOUNT field... I would like to have the calculated field in result, showing 80. (Because a 20% of discount from 100 dollars, are 20 dollars, so 100 dollars - 20 dollars = 80 dollars) Of course, if I have to perform a query for every single entry in my table, I would get crazy, so I need a way, in which I can obtain a calculated field How may I do this, without running a query?

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Alex Kemp
close date 2015-11-05 18:40:34.369471

2 Answers

Sort by » oldest newest most voted
0

answered 2013-08-03 01:37:16 +0100

m.a.riosv gravatar image

I think default BASE engine (HDBSQL) have not computed FIELDS.

But you can simplify a bit the expression:
RESULT = AMOUNT * (1-DISCOUNT)

And I do not understand what do you mean with "if I have to perform a query for every single entry in my table". You can set parameters in the query, see the documentation:
https://wiki.documentfoundation.org/Documentation/Publications#LibreOffice_Base_Handbook
for Queries chapter.

edit flag offensive delete link more
0

answered 2013-08-03 02:35:53 +0100

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

What I mean is I want the calculations be performed in real time whilst I am introducing the data in the table, if I vinculate a query with the table, I have to finish all the entries in my table and then, go to the query, run the query, and then, get the calculated field back in my table I don't want that I want to introduce the data in my table, and get automatically the calculated field.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2013-08-03 00:40:38 +0100

Seen: 1,961 times

Last updated: Aug 03 '13