Tips & Tricks - Calculation
In this article, you'll learn how to use the Formula Editor to perform calculations in view tables.
Total Calculation
With this type of calculation, the calculated value is displayed below a table column.
First, create a new application using the "Basic Application" template.
On the "All Entries" page, you'll find a table. For the calculations, we use a floating-point data field that is embedded in the table. Go to the "Entry" input page.
Double-clicking the grid row containing the "Title" input field switches to the zoom area.
Create a new input field here, below the title. The Properties dialog box opens automatically.
Select the "New Data Field" option and click "Next."
Name the new input field "Value" and select the "Floating-point number" control type. Click "Next." After completing the final settings that follow, click "Finish."
Go back to the "All Entries" page and open the properties dialog for the view table.
On the "All Entries" page (1), double-click to open the Properties dialog box for the view table (2). Click "Add Column" (3) on
to add the new data field "Value" (4). General information on how to create a new table column can be found here.
Save the change by clicking "OK."
Also confirm the Properties dialog box for the view table by clicking "OK," and then open the Properties dialog box again.
Click "Edit Area for Overall Calculation" under "
."
Select the cell below the "Value" column here and click "
" "Add Check."
Then select "Calculation" from the menu that appears.
You can now create the formula by clicking "Edit Control" at
.
Enter a title here and click "Edit Formula"
.
You can find the Intrexx Formula Collection in the library. In the "Functions" category, select
"Table Functions / Aggregate Functions for Column Values / Column Values of the Records (Current View) / Sum"
the formula "Total from Control." The Formula
sum(table("<tableGuid>"), row("<tableControlGuid>", <fallbackValue>))
can be inserted by double-clicking in the editor's workspace.
If the "Application Structure" tab is not visible in the right-hand pane next to "Libraries," display it using the "View / Application Structures" menu.
In the application structure, you'll find the view table under "All Entries / FormGroup / Grid / Container 2."
Select the "tablerecords" entry there.
Replace the <tableGuid> portion of the formula with the GUID displayed below. To do this, simply select the relevant part of the formula in the workspace and then double-click the GUID below the application structure. The GUID is then automatically inserted and replaces the selected part of the formula.
Replace the <tableControlGuid> section with the GUID of the "Value" control.
An optional fallback value is not needed for our example—this part can be removed from the formula.
Close all open dialog boxes by clicking "OK," save the application, and test the result in the browser by entering values into the application.
Calculation in a separate column of the table
It is also possible to create a separate column in the table for the calculation—as shown in the figure above, for example, using the same formula, which then displays the sum for each row in the "Value 2" column.
To select the calculation method, simply choose the "Calculation" menu when creating a new table column. You are already familiar with the steps that follow from the overall calculation.
More Information














