1Get Calculated Members
Overview
This API retrieves calculated members from a Semantic Model.
Method: POST
Request URL: {kyvos-url}/rest/v2/semantic-models/{name-or-id}/calculated-members
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 |
|---|---|---|---|
Content-Type (Required) | String | Specifies the media type of the request body. |
|
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 |
|---|---|---|---|
name-or-id (Required) | String | Name or ID of the Semantic Model from which calculated members are to be retrieved. Note: If the Semantic Model name is provided, either folderName or folderId must also be provided. | – |
Query Parameters
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 |
|---|---|---|---|
membersJson (Required) | String | An array containing JSON objects with details of the calculated members to be retrieved. Note: An example JSON is provided under the Resources section below. | – |
Responses
200 Success
{
"calculatedMembers":[
{
"expression":"[Customer].[H_Customer].[Name].&[Adam Miller]",
"name":"memberName3",
"description":"RestAPI",
"id":"17774561929407127091090133193817",
"parentMemberUname":{
"parentId":"[RestAPI].[H_RestAPI]",
"content":"ALLMEMBER"
},
"parentHrch":"H_678469",
"parentLevelMemb":"ALLMEMBER",
"lat":"",
"long":"",
"solveOrder":""
}
]
}Status Code | Description |
|---|---|
401 | Authorization information is missing or invalid. |
404 | No matching record found. |
412 | Precondition failed. Required parameter is missing. |
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" |