Variable
A variable of a VARIABLES axis: a survey variable, a user variable, a target used as a variable or a total.
Identifier of the variable: the variable id for VAR and CUSTOM_VAR, the saved target id for TARGET_VAR. Not used for TOTAL.
Label of the variable, in the language of the user. Always returned in responses.
Kind of variable of a VARIABLES axis. Values are case-sensitive.
| Enum Value | Description |
|---|---|
| VAR | Survey variable. |
| CUSTOM_VAR | User variable saved in the workspace. |
| TARGET_VAR | Target, a saved one by id or a TGL expression in filterTgl, used as a variable. |
| TOTAL | Total, with no variable behind it. |
Possible values: [VAR, CUSTOM_VAR, TARGET_VAR, TOTAL]
How the variable is measured. Required for VAR and CUSTOM_VAR; ignored for TARGET_VAR and TOTAL. An unknown value returns 400 AE_ERR_401.
| Enum Value | Description |
|---|---|
| SINGLE | Categorical variable with one answer per respondent. |
| MULTIPLE | Categorical variable with several answers per respondent. |
| NUMERIC | Numeric variable with integer values. |
| REAL | Numeric variable with decimal values. |
| FREQUENCY | Frequency variable. |
| LOGIC | Logical variable, true or false. |
| WEIGHTED | Weighted numeric variable. |
| TOTAL | Total, with no variable behind it. |
| TEXT | Free text. Surveys return it, but it cannot be tabulated: sending it returns AE_ERR_416. |
Possible values: [SINGLE, MULTIPLE, NUMERIC, REAL, FREQUENCY, LOGIC, WEIGHTED, TOTAL, TEXT]
categories object[]
Categories to calculate, for a categorical variable. Omit it to use all of them.
Code of the category within its variable. For a JOINT, an id chosen by the caller for the joint. Responses return the base category with id BASE.
Member category ids of a JOINT category. When omitted, the joint contains only id. Ignored for the other types.
Category label, in the language of the user. Required when the variable is in a split axis (split: true), because split categories are matched by label. Always returned in responses.
Kind of category of a variable. Values are case-sensitive, except JOINT.
| Enum Value | Description |
|---|---|
| CATEGORY | A category of a survey variable. |
| CUSTOM_CAT | A category of a user variable. |
| JOINT | The union of the categories listed in ids. |
| BASE | The base category: responses return it with the id BASE. |
Possible values: [CATEGORY, CUSTOM_CAT, JOINT, BASE]
Marks the category that fixes the slice when its variable is in a PLANES axis. In PLANES, several categories can be selected (one matrix each); in any other axis, more than one returns 400 AE_ERR_404.
TGL condition of a CUSTOM_CAT category of a user variable (CUSTOM_VAR, subtype SINGLE or MULTIPLE). GET /api/v2/workspace/{workspaceId}/element/{elementId} returns it with resolve=TGL. Send it back unchanged: when every CUSTOM_CAT category of the variable has one, the calculation uses them and does not look the variable up by id. A tgl anywhere else returns 400 AE_ERR_416.
Marks a CUSTOM_CAT category that is not shown as a row or column but is needed by a JOINT of the same variable. Returned only as true and only with tgl (see resolve in GET /api/v2/workspace/{workspaceId}/element/{elementId}). Send it back unchanged. Accepted only on a CUSTOM_CAT category of a CUSTOM_VAR with subtype SINGLE or MULTIPLE; anywhere else true returns 400 AE_ERR_416.
TGL expression of a TARGET_VAR defined inline. Responses return it for a target calculated from an expression, so the variable can be sent back unchanged.
Whether this variable is the selected one in its axis. Used to pick the slice in the PLANES dimension. Only one variable per axis can be marked as selected outside PLANES; sending more than one in such an axis results in a 400 Bad Request.
{
"id": "string",
"label": "string",
"type": "VAR",
"subtype": "SINGLE",
"categories": [
{
"id": "string",
"ids": [
"string"
],
"label": "string",
"type": "CATEGORY",
"selected": true,
"tgl": "string",
"hidden": true
}
],
"filterTgl": "string",
"selected": true
}