Skip to main content
Class for using the Service statistics library.

Constructors

StatLib()

Initializes a new instance of the StatLib class.

Methods

addAggregate(Integer,Integer,String,String,Integer)

Adds an aggregate function to the specified group An aggregate function is a function that is calculated for all values for a given column in a group. For example, the average response time for each category.
Returns: CRMScript.Global.Void
Available functions:
  • Count
  • Sum
  • Avg
  • Max
  • Min

addAggregate(Integer,Integer,String,String,Integer,Integer)

Adds an aggregate function to the specified group An aggregate function is a function that is calculated for all values for a given column in a group. For example, the average response time for each category.
Returns: CRMScript.Global.Void
Available functions:
  • Count
  • Sum
  • Avg
  • Max
  • Min

addCallback(Integer,String)

Adds a callback. A callback is a PARSER-snippet that will be executed for the given column for each row.
Returns: CRMScript.Global.Void
This is an old method. Use StatResult and iterate instead.

addGroup(Integer,Bool)

Adds a group to the StatLib instance. A group is a subset of the results that have a common value for a given column. Aggregate values can be calculated for groups, for example, the average response time per category.
Returns: CRMScript.Global.Void

addGroup(Integer,Bool,Bool)

Adds a group to the StatLib instance. A group is a subset of the results that have a common value for a given column. Aggregate values can be calculated for groups, for example, the average response time per category.
Returns: CRMScript.Global.Void

dropOrder()

Calling this function will make the StatLib instance skip sorting the results in the groups.
Returns: CRMScript.Global.Void

execute(Parser)

Runs the query and aggregations and stores the results in a Parser
Returns: CRMScript.Global.Void
You can choose between storing in a Parser or a StatResult by passing the appropriate object.

execute(StatResult)

Runs the query and aggregations and stores the results in a StatResult
Returns: CRMScript.Global.Void
You can choose between storing in a Parser or a StatResult by passing the appropriate object.

setGenericSearch()

Use the given GenericSearch entry as query (instead of SQL string).
Returns: CRMScript.Global.Void

setName(String)

Sets the name for the instance. The name is used to prefix the result in the Parser.
Returns: CRMScript.Global.Void

setSearchEngine()

Use the given SearchEngine entry as query (instead of SQL string).
Returns: CRMScript.Global.Void

setSql(String)

Sets the query for the instance. This method is not available in CRM Online.
Returns: CRMScript.Global.Void

setStringMatrix()

Use the given StringMatrix entry as query (instead of SQL string).
Returns: CRMScript.Global.Void