Ask LibreOffice - RSS feedhttps://ask.libreoffice.org/en/questions/Questions and answers for LibreOfficeenSat, 15 Aug 2015 11:42:14 +0200(SOLVED) Further calculations from calculated fields in Basehttps://ask.libreoffice.org/en/question/56190/solved-further-calculations-from-calculated-fields-in-base/ Complete newbie to databases as well as SQL.
Calculated fields are quite easy.. eg; "Field Name1" + "Field Name2"
In my database I need further calculations from calculated fields within the same query.
Here is what I have so far:
BuyPrice
S/H Paid
TaxPaid
"BuyPrice" + "S/H Paid" + "TaxPaid"
When the query runs, this outputs to a field with an alias of Total Cost
SellPrice
S/H Charged
"SellPrice" + "S/H Charged" - ( "SellPrice" * 0.132 + "S/H Charged" * 0.132 )
This outputs to a field with an alias of NET
This is exactly what I need, however I also need a third calculated field for **Profit**. I cant just enter "NET" - "Total Cost". If I create another query on top of the first one, I can reference the aliases and it works just fine but I need this to all go into the same "**Table Control**"
Works but it is in two separate Table Control forms
I simply don't know enough about any of this to get it to work.. any help or suggestions would be greatly appreciatedbdragon254Sat, 15 Aug 2015 11:42:14 +0200https://ask.libreoffice.org/en/question/56190/Calcultated fields in query (how to output in currency format) ?https://ask.libreoffice.org/en/question/48462/calcultated-fields-in-query-how-to-output-in-currency-format/Hello
I'm having some problems creating a query in DesigView mode.
**I'm trying to calculate a field with an Alias.**
So I have a field in which I have MonthlyGrossWage, that field is numeric, has no decimals (for simplicity), only 5 digits, and its format is currency $
In my table, I have a the name of my employees, name, lastname, etc... and also this field MonthlyGrossWage... so I enter John.... Doe... 1150$...
Okay that is fine.
I have my table with all my employees names, lastnames... and also the salary they get monthly at monthlygrosswage
Okay...
How much cost me the employee per hour?
Assuming we have a labour day of 8 hours, I'd divide the monthlygrosswage by 8
So the calculation it's quite simple.
"MonthlyGrossWage" / 8
...
in query designview I add also an alias, so I can **output** the result of the **calculation** in a field... let's say my **Alias** is HourlyGrossWage
So... my **query design view looks like this:**
"MonthlyGrossWage" / 8
HourlyGrossWage
Perfect.
What happend now is I display the proper calculation in the field HourlyGrossWage...
but! I don't see the result in dollars !!! and of course I'd like to see it in dollars... so I get the **calculation** but I cannot setup the **format of the output field**...
How may I do this?
CheersmrmisterSun, 29 Mar 2015 15:03:56 +0200https://ask.libreoffice.org/en/question/48462/Can we have calculated fields in LibreOffice Base?https://ask.libreoffice.org/en/question/27032/can-we-have-calculated-fields-in-libreoffice-base/Hello
I'd like to know if can we have calculated fields in LibreOffice Base.
Please, realize I do not mean about getting the calculated fields when performing a query.
I mean, to get the calculated field during the entry data process whilst you are in the table.
Example: I have a table with three fields:
- FIELD 1 (INTEGER): First Quantity
- FIELD 2 (INTEGER): Second Quantity
- FIELD 3 (INTEGER): Result
So imagine the table, I am there... I enter 2 in the first field (First Quantity), and now in the next field (Second Quantity) I type 2 ... and now, what I want to see in the third field (Result) is the sum of First Quantity + Second Quantity, that is 2 + 2 = 4
May I have that whilst I am introducing data in the table, and get a field with calculated results?
Or the only way to get calculated results is when performing a query?
ThanksmrmisterWed, 11 Dec 2013 15:52:34 +0100https://ask.libreoffice.org/en/question/27032/How may I do a calculated field in Base without a query?https://ask.libreoffice.org/en/question/21042/how-may-i-do-a-calculated-field-in-base-without-a-query/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?mrmisterSat, 03 Aug 2013 00:40:38 +0200https://ask.libreoffice.org/en/question/21042/