Class RVDataModelCalculatedField

java.lang.Object
io.revealbi.core.data.RVDataModelField
io.revealbi.core.data.RVDataModelCalculatedField

public class RVDataModelCalculatedField extends RVDataModelField
Represents a calculated field in the data model.

Extends RVDataModelField with an expression that defines the calculation. Use this with IRVDataModelProvider.getCalculatedFields(RVDataSourceItem, io.revealbi.core.IRequestContext) to inject custom calculated fields into a data source.

API Note:
This class is part of the beta IRVDataModelProvider API and may change in future releases.
  • Constructor Details

    • RVDataModelCalculatedField

      public RVDataModelCalculatedField(String name, RVDashboardDataType type, String expression)
      Creates a new calculated field with the given name, type, and expression.
      Parameters:
      name - The name of the calculated field.
      type - The data type of the result.
      expression - The expression that defines the calculation.
  • Method Details

    • getExpression

      public String getExpression()
      Returns the expression that defines this calculated field.
      Returns:
      The calculation expression.
    • setExpression

      public void setExpression(String expression)
      Sets the expression that defines this calculated field.
      Parameters:
      expression - The calculation expression.