prod function in the Factory

The prod function returns the product of the column, evaluated within groups defined by the group parameter if required.


Parameters

prod(column, group)

Parameter

Description

column

The attribute used to evaluate the product. Multiple attributes can be specified, as long as they are enclosed in double brackets, i.e. column((column1, column2)). The column parameter is mandatory.

group

The attribute by which you want to group your results. Multiple attributes can be specified, as long as they are enclosed in double brackets, i.e. prod(column,(group1,group2)).


Example

The following example uses the Prod dataset.

This example isn’t based on a real scenario, it only explains how to use the function.

Description

Screenshot

In this example, we want to evaluate the product of all the values within the Var_2 attribute, grouped by the Var_1 attribute’s values. Add a new attribute, then type the following formula:

prod($"Var_2",$"Var_1")

The results can be read as follows:

  • For 1 as Var_1 value, the product of Var_2 is 70368744177664

  • For 2 as Var_1 value, the product of Var_2 is 18014398509481984