# rptgroupfunc

> Source: https://manual.pvxplus.com/report-writer/object-oriented-interface/rptgroupfunc/overview

The **rptgroupfunc** object is a data member of the **[pvxreport](https://manual.pvxplus.com/report-writer/object-oriented-interface/pvxreport/overview)** object interface, delegated to store and manipulate a group function definition. One object is created for each function. The **pvxreportGetGroupFunc( )** method can be used to retrieve the object handle for an **rptgroupfunc** object, which allows access to all the object' methods and properties.

## rptgroupfunc Properties

The following table lists the properties of the **rptgroupfunc** object:

| **Property** | **Description** |
| --- | --- |
| **Element$** | Data element to be used in the function calculation. This must start with an alphanumeric, optionally followed with alphanumeric, **.** (*period*) or **\_** (*underscore*) characters.  <br>  <br>No trailing $ for string elements. Set to null if the element name is invalid. |
| **Format$** | Format mask for displaying the value. |
| **Function$** | Name of the group function.  <br>  <br>Possible values are **AVERAGE, COUNT, MAXIMUM, MINIMUM, SUM**. Set to null if the function name is invalid. |
| **Type$** | Single character code to indicate whether the function element contains string or numeric data:  <br>  <br> **S** - String/text   <br> **N** - Numeric/computational  <br>  <br>Set to null if code is invalid. |

## rptgroupfunc Methods

The following table lists the methods of the **rptgroupfunc** object:

| **Method** | **Description** |
| --- | --- |
| **GetGroupFunctionDefinition$( )** | Returns a formatted string based on **rptgroupfunc** properties. The format of the string is that used to define a **Function=** entry in the report definition file.<br>Format for **COUNT** function: **COUNT\[(** *element* **)\]:** *format  <br>  <br>**Example:***  <br>  <br> COUNT:###,##0, COUNT(Manager):##0  <br>  <br>Format for other functions: *FuncName* **(\[** *convert* **\]** *element* **):** *format  <br>  <br>**Example:***  <br>  <br> AVERAGE (Balance):###,###,##0.00  <br> MAXIMUM(Convert CustID):000000  <br>  <br>Returns null if the information in **rptgroupfunc** object is invalid. |
| GetGroupFunctionVariable$(*LevelID$***)** | Returns the name of the group function variable based on the current **Function$**, **Element$** and **Type$** properties and the given *LevelID$.*  <br>  <br>*LevelID$:*<br>\|  \|  \|<br>\| --- \| --- \|<br>\| **00** \| Report Summary level \|<br>\| **01 - 16** \| Control break group level \|<br>\| **DL** \| Detail line level \|<br>***Example:***  <br>  <br> \_SUMDLN_Balance, \_AVG03N_Amount, \_CTR00N, \_CTR03N_Manager |
| SetGroupFunctionDefinition$(*Def$***)** | Assigns **rptgroupfunc** properties based on a formatted string. The format of the string is that used to define a **Function=** entry in the report definition file. Returns **1**.  <br>  <br>*Def$ -* Formatted string containing the group function information:  <br>  <br>Format for **COUNT** function: **COUNT:** *format  <br>  <br>**Example:***  <br>  <br> COUNT:###,##0.  <br>  <br>Format for other functions: *FuncName* **(\[** *convert* **\]** *element* **):** *format  <br>  <br>**Example:***  <br>  <br> AVERAGE (Balance):###,###,##0.00   <br> MAXIMUM(Convert CustID):000000 |
