Add and Update Calculated Members
Resources
Below is an example of JSON structure which can be used as a reference for the membersJson parameter in the request body.
{
"memberNameTest":{
"dimensionName":"AccountDim",
"type":"ATTRIBUTE",
"attributeName":"accountid",
"parentMember":"",
"expression":"SUM(TopCount([Location].[Location].[Country].Members, 10), [Measures].[Sales])",
"solveOrder":"",
"description":"Test"
}
}JSON Fields Description
Field | Type | Description | Possible Values | Example |
(root) | JSON Object | Root JSON object where each key is the calculated member name and value is the member configuration | Object with member name keys | {"Q1 Total": {...}} |
{memberName} | JSON Object | Configuration for a calculated member. The key itself is the member name | - | {"dimensionName": "...", ...} |
dimensionName | String | Name of the dimension where this calculated member will be created. Required field | "Time", "Product", "Geography" | "Time" |
type | String | Type of the parent element - whether the calculated member is based on a hierarchy or an attribute. Required field | "HIERARCHY", "ATTRIBUTE" | "HIERARCHY" |
hierarchyName | String | Name of the hierarchy where the calculated member will be placed. Required when type=HIERARCHY and the dimension has multiple hierarchies | "Fiscal Calendar", "Calendar" | "Fiscal Calendar" |
attributeName | String | Name of the attribute where the calculated member will be placed. Required when type=ATTRIBUTE | "Product Category", "Region" | "Product Category" |
parentMember | String | The parent member under which this calculated member will be created. Use "ALLMEMBER" for top-level members. For other levels, provide the fully qualified member name in format: [Level name].memberUniqueName | "ALLMEMBER", fully qualified member name | "ALLMEMBER", "[Quarter].[Q1]", "[Year].[2024]" |
expression | String | MDX expression that defines the calculated member's value. This is the formula used to compute the member. Required for new members | Valid MDX expression | "[Time].[Month].[Jan] + [Time].[Month].[Feb] + [Time].[Month].[Mar]" |
solveOrder | String | Solve order for the calculated member. Determines evaluation order when multiple calculated members interact. Higher values are evaluated later | "0", "1", "100" | "0" |
description | String | Description of the calculated member explaining its purpose and usage. Maximum 200 characters | Free-form text (max 200 chars) | "Represents the total for Q1 by summing January, February, and March values" |