Calculate
Update and re-evaluate a specific calculation in a CalcTree workspace
The Calculate mutation allows you to update and re-evaluate a specific calculation in a CalcTree workspace by providing input statements. It is used to perform a calculation based on provided input values. It takes a set of input statements, processes them, and returns the updated values for each statement in the calculation.
Input Parameters
workspaceId
ID!
Yes
The unique ID of the CalcTree workspace
calculationId
ID!
Yes
The unique ID of the calculation
revisionId
ID!
Yes
The unique ID of the revision to calculate
statements
[StatementInput!]!
Yes
An array of input statements for the calculation
Sample Mutation
Sample Variables
Sample Response
Description of Returned Fields
revisionId
String
The unique ID of the new calculation revision
calculationId
String
The unique ID of the calculation
statements
Array
An array of the calculated statements
statementId
String
The unique ID of the statement
title
String
The title of the statement
formula
String
The formula used in the statement
namedValues
Array of Objects
An array of name-value pairs representing variables and their calculated values
Usage Example in Python
Here’s how to use the Calculate
mutation in Python using the requests
library:
Tips for Using the Mutation
Ensure your
workspaceId
,calculationId
,revisionId
, andstatements
are accurate.Use the calculate query to extract the statement structure and statementIDs to use as inputs in this mutation
Unless working with a specific revision, set revisionID to "ffffffff" to access the latest version of the calculation.Comment
Use the namedValues array to understand the inputs and outputs of each statement.
The mutation allows you to perform multiple calculations in a single request by providing a list of statements.
Last updated