> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# StatResult

> Used to access the results of a StatLib execution.

Used to access the results of a StatLib execution.

## Constructors

### StatResult()

```crmscript theme={null}
StatResult
```

Initializes a new instance of the StatResult class.

## Methods

## atGroupBegin(Integer)

Checks if the current row is the first row for a given group.

```crmscript theme={null}
Bool atGroupBegin(Integer column)
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - True if we're at the first row for this group; otherwise, false.

## atGroupEnd(Integer)

Checks if the current row is the last row for a given group.

```crmscript theme={null}
Bool atGroupEnd(Integer column)
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - True if we're at the last row for this group; otherwise, false.

## dumpParser()

Returns a string with everything in the StatResult parser listed.

```crmscript theme={null}
String dumpParser()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - A string with everything in the StatResult parser listed.

<Note>
  Mainly used for debugging and development. It will show you every variable in the StatResult parser.
</Note>

## eof()

Checks if the internal iterator is past the last element.

```crmscript theme={null}
Bool eof()
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - True if the internal iterator is past the last element; otherwise, false.

## getField(Integer)

Returns the value for the given field at the current row.

```crmscript theme={null}
String getField(Integer column)
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The value for the given column at the current row.

<Note>
  You can specify the field either by its name or its column. Normally used to retrieve values from aggregate functions.
</Note>

## getField(String)

Returns the value for the given field at the current row.

```crmscript theme={null}
String getField(String field)
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The value for the given field at the current row.

<Note>
  You can specify the field either by its name or its column. Normally used to retrieve values from aggregate functions.
</Note>

## next()

Moves the internal iterator to next element.

```crmscript theme={null}
Bool next()
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - Eof() after move.

## rewind()

Rewinds the internal iterator.

```crmscript theme={null}
Void rewind()
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

## saveAsResult(Integer,Integer,Integer)

Returns a reference to a result set.

```crmscript theme={null}
Integer saveAsResult(Integer column, Integer ownerId, Integer maxRows)
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - A reference to the result set.

**Example:**

```crmscript theme={null}
setVariable("url", getProgram(1) + "&action=listTickets&special=11&resultKey=" + resKey .toString());
```


## Related topics

- [StatLib](/en/automation/crmscript/reference/CRMScript.Native.StatLib.md)
- [Namespace CRMScript.Native](/en/automation/crmscript/reference/CRMScript.Native.md)
- [Using StatLib class in CRMScript for reporting](/en/automation/crmscript/tutorials/using-crmscript-statlib-for-reporting.md)
- [CRMScript Reference](/en/automation/crmscript/reference/index.md)
- [Analyze your mailing results](/en/marketing/mailing/learn/view-statistics.md)
- [NSCheckLicenseStatusResult](/en/automation/crmscript/reference/CRMScript.NetServer.NSCheckLicenseStatusResult.md)
