calculate_array_formula method

calculate_array_formula

Calculates a formula as array formula.

def calculate_array_formula(self, formula, opts):
    ...
ParameterTypeDescription
formulastrFormula to be calculated.
optsCalculationOptionsOptions for calculating formula

calculate_array_formula

Calculates a formula as array formula.

Returns

Calculated formula result.

def calculate_array_formula(self, formula, opts, max_row_count, max_column_count):
    ...
ParameterTypeDescription
formulastrFormula to be calculated.
optsCalculationOptionsOptions for calculating formula
max_row_countintthe maximum row count of resultant data.
If it is non-positive or greater than the actual row count, then actual row count will be used.
max_column_countintthe maximum column count of resultant data.
If it is non-positive or greater than the actual row count, then actual column count will be used.

Remarks

The formula will be taken as dynamic array formula to calculate the dimension and result. User specified maximum dimension is used for cases that the calculated result is large data set (for example, the calculated result may correspond to a whole row or column data) but user does not need so large an array according to business requirement or for performance consideration.

calculate_array_formula

Calculates a formula as array formula.

Returns

Calculated formula result.

def calculate_array_formula(self, formula, p_opts, c_opts, base_cell_row, base_cell_column, max_row_count, max_column_count, calculation_data):
    ...
ParameterTypeDescription
formulastrFormula to be calculated.
p_optsFormulaParseOptionsOptions for parsing formula
c_optsCalculationOptionsOptions for calculating formula
base_cell_rowintThe row index of the base cell.
base_cell_columnintThe column index of the base cell.
max_row_countintThe maximum row count of resultant data.
If it is non-positive or greater than the actual row count, then actual row count will be used.
max_column_countintThe maximum column count of resultant data.
If it is non-positive or greater than the actual row count, then actual column count will be used.
calculation_dataCalculationDataThe calculation data. It is used for the situation
that user needs to calculate some static formulas when implementing custom calculation engine.
For such kind of situation, user needs to specify it with the calculation data provided
for AbstractCalculationEngine.calculate.

Remarks

The formula will be taken as dynamic array formula to calculate the dimension and result. User specified maximum dimension is used for cases that the calculated result is large data set (for example, the calculated result may correspond to a whole row or column data) but user does not need so large an array according to business requirement or for performance consideration.

See Also