Skip to main content

Introduction

Last updated 13/11/2024

Functions

Five's reports have a number of inbuilt functions that can be used to assist you to create your reports.

  • _Chart - Inserts an image of a chart you have saved in Five.
  • _Image - Inserts an image you have saved in Five.
  • _Each - Processes the records returned.
  • _GroupBy - Groups rows that have the same values into summary rows.
  • _Sum - Returns the sum of a number field.
  • _Sort - Sorts the records returned.
  • _IfHasRecords - Processes the records returned if there are records.
  • _With - Uses the properties from the current record.
  • _ColumnCount - Returns the total column count in a table.
  • _RowCount - Returns the total row count in a table.
  • _TotalRecords - Returns the total records.

You are not limited to functions supplied by Five. You can create your own functions by using the code editor in the Code field. Any functions added by you will be available in the Fields window when you select Custom Made as the category.

Add a Built In Function

1. After giving your report a title and adding your data sources, click in the Template field.


Template field
Figure 1 - Template field

2. Click the Insert Fields button in the toolbar.


Insert Fields button
Figure 2 - Insert Fields button

3. Click the lookup icon in the Category field and select Built In.

4. Click the lookup icon in the Function field and select a function name.


Fields window
Figure 3 - Fields window

5. Continue to configure the Fields page and click the Insert button.


Insert button
Figure 4 - Insert button

Add a Custom Function

For this example a custom made function will be added to the Total field in a table. As the function is only being added to a cell the helper type will be inline.

1. After giving your report a title and adding your data sources, click in the Code field.


Code field
Figure 5 - Code field

2. Add and save your function.

tip
You can add multiple functions in the code editor for your report!

Add your function
Figure 6 - Add your function

3. Click in the Template field.


Template field
Figure 7 - Template field

4. Click in the cell you want to apply the function to.


Cell
Figure 8 - Cell

5. Click the Insert Fields button in the toolbar.


Insert Fields button
Figure 9 - Insert Fields button

6. Click the lookup icon in the Category field and select Custom Made.

7. Click the lookup icon in the Function field and select your function name.

tip
Your function and the field record for the cell need to be added at the same time, otherwise the previous field value will be overwritten!

Fields window
Figure 10 - Fields window

8. Continue to configure the Fields page and click the Insert button.


Insert button
Figure 11 - Insert button

info
Your function will be applied to your template.

Function is applied
Figure 12 - Function is applied