1Add and Update Calculated Members

1Add and Update Calculated Members

Overview

This API adds or updates calculated members in a Semantic Model. Updates are applied only to calculated members, non-calculated members are ignored.

Method: POST

Request URL: {kyvos-url}/rest/v2/semantic-models/{name-or-id}/calculated-members/save


Authorization

API Key: sessionid

This method authenticates requests using a session ID which acts like an API key.


BasicAuth: HTTP Authorization Scheme

This method authenticates requests using a username and password sent in the HTTP Authorization header.


Headers

Header Name

Type

Description

Possible Values

Header Name

Type

Description

Possible Values

Content-Type (Required)

String

Specifies the media type of the request body.

application/x-www-form-urlencoded

sessionid

String

The session ID is the token received from the login API.

Note: Session ID is required for token-based authentication.

–


Path Parameters

Parameter Name

Type

Description

Possible Values

Parameter Name

Type

Description

Possible Values

name-or-id (Required)

String

Name or ID of the Semantic Model in which the calculated members are to be added or updated.

Note: If the Semantic Model name is provided, either folderName or folderId must also be provided.

–


Query Parameters

Parameter Name

Type

Description

Possible Values

Parameter Name

Type

Description

Possible Values

by

String

Specifies whether the name-or-id parameter should be interpreted as a Semantic Model name or Semantic Model ID.

If by=name, provide the Semantic Model name in the name-or-id parameter.

If by=id, provide the Semantic Model ID in the name-or-id parameter.

The default value is name.

–

folderName

String

Name of the folder containing the Semantic Model. If the Semantic Model is present in the root directory, specify [Root].

Note: If neither folderName nor folderId is provided, the Semantic Model will be treated as a root-level entity by default.

–

folderId

String

ID of the folder containing the Semantic Model.

–


Request Body

Parameter Name

Type

Description

Possible Values

Parameter Name

Type

Description

Possible Values

membersJson (Required)

String

A JSON string where each key represents the name of a calculated member, and its value is a JSON object containing the required details, including a description field.
The description must be a string with a maximum length of 200 characters.

Note: An example JSON structure is provided under the Resources section below.

–

validate

Boolean

Indicates whether to validate the member expression.

Note: Expressions are validated only if the Semantic Model has been built.

true / false

Default: true

save

Boolean

Indicates whether to save the member expression.

true / false

Default: true


Responses

200 Success

{ "code": 0, "message": "Successfully updated semantic model object: account" }

Status Code

Description

Status Code

Description

401

Authorization information is missing or invalid.

412

Precondition failed. Required parameter is missing.

404

No matching record found.

500

Internal Server Error


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"

Copyright Kyvos, Inc. 2026. All rights reserved.