Skip to main content
Updates existing custom metric or creates a new one if custom metric with {customMetricName} doesn't exist

Authorizations

Authorization
string
header
required

HTTP Basic authentication using global administrator credentials (username and password).

Path Parameters

sourceId
string
required
customMetricName
string
required
Maximum string length: 255

Body

application/vnd.composer.v3+json

Custom metric representation

expression
string
required

Expression that defines the custom metric

Example:

"SUM(sales_in_usd) + SUM(sales_in_uah) * uah_to_usd_exchange_rate"

name
string

Unique identifier of the custom metric within the source across all custom metrics and fields. It's immutable and may be specified in create request only

Maximum string length: 255
Example:

"sum_of_sales"

label
string

User visible representation of the custom metric.

Maximum string length: 255
Example:

"Sum of Sales"

visible
boolean

Whether the custom metric should be visible to users on a visual

numberFormat
object

Number format of the custom metric value display

timeFormat
object

Time format of the custom metric value display

granularity
enum<string>
deprecated

The minimum time granularity of this field.

Available options:
MILLISECOND,
SECOND,
MINUTE,
HOUR,
DAY,
WEEK,
MONTH,
QUARTER,
YEAR
dataType
enum<string>

Data type of the custom metric. It’s detected automatically based on the metric expression

Available options:
ATTRIBUTE,
NUMBER,
INTEGER,
TIME,
TEXT,
HIERARCHY,
NULL

Response

The custom metric was updated

Custom metric representation

expression
string
required

Expression that defines the custom metric

Example:

"SUM(sales_in_usd) + SUM(sales_in_uah) * uah_to_usd_exchange_rate"

name
string

Unique identifier of the custom metric within the source across all custom metrics and fields. It's immutable and may be specified in create request only

Maximum string length: 255
Example:

"sum_of_sales"

label
string

User visible representation of the custom metric.

Maximum string length: 255
Example:

"Sum of Sales"

visible
boolean

Whether the custom metric should be visible to users on a visual

numberFormat
object

Number format of the custom metric value display

timeFormat
object

Time format of the custom metric value display

granularity
enum<string>
deprecated

The minimum time granularity of this field.

Available options:
MILLISECOND,
SECOND,
MINUTE,
HOUR,
DAY,
WEEK,
MONTH,
QUARTER,
YEAR
dataType
enum<string>

Data type of the custom metric. It’s detected automatically based on the metric expression

Available options:
ATTRIBUTE,
NUMBER,
INTEGER,
TIME,
TEXT,
HIERARCHY,
NULL