In the online doc: http://confluence.atlassian.com/display/DOC/Creating+a+Page+using+a+Template
the example shows an Order Form with Product, Quantity, Price and Total.
My question is: Is there a way to not have to enter the Total and have that be calculated (Quantity * Price)?
Is this possibel in Confluence? Can this be done as part of the page template?
Thanks!
Community moderators have prevented the ability to post new answers.
Another idea I found was to create a User Macro and insert some javascript to do calculation of the "fields" -- you do have to match up the User Macro to the fields used in the Page Template. . . but it does work!
Hello!
For any calculations in Confluence, including calculations over tables, you may use CelesteCS Math for Confluence. There are versions for both Confluence Server and Confluence Cloud.
Assume you have a table with three rows and four columns: A till D with two rows and want to summarize elements from B2 to D2. Then here is the formula you should specify in A2:
SUM(Table1.B2:D2)
If you want to calculate average value, use AVG function:
AVG(Table1.B2:D2)
As you see, it is very simple and is similar to EXCEL with equal set of functions.
There is a plenty of other functions in the macro, so you may perform any calculations using formulas in EXCEL style.
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi there,
To achieve this, you will need to use a combination of either Scaffolding or Metadata, along with the Reporting Plugin. Note that Scaffolding and Reporting currently only work up to Confluence 3.5, not 4.0. For example, based on the link you posted:
------------
{table-data:Items}
|| Product || Quantity || Price || Total ||
| {text-data:Product} | {number-data:Quantity} | {number-data:Price||format='$'#,##0.00} | {eval-data:Total|format='$'#,##0.00}${Quantity} * ${Price}{eval-data} |
{table-data}
*Grand Total:* {eval-data:Grand Total|format='$'#,##0.00}sumtable("Items", "Total"){eval-data}
------------
The above actually just uses the Scaffolding plugin, but Reporting can give you even more power, particularly if you want to work with multiple pages using the same template. The other advantage of Scaffolding is that when you hit 'Edit' again, you still get nice form fields to fill out, rather than the text just becoming another part of the page.
Hope that helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Another idea I found was to create a User Macro and insert some javascript to do calculation of the "fields" -- you do have to match up the User Macro to the fields used in the Page Template. . . but it does work!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.