Update metric
PATCH {{baseUrl}}/api/-/pulse/metrics/:metric_id
Updates the specification of a metric.
Version: Available in API 3.21 (Tableau Cloud December 2023) and later. Not available for Tableau Server. Versioning Overview
Permissions: Any user can create a metric in a definition as long as the user has write or publish access to the data source used in the definition. Permissions Overview
License: No additional license required.
Access Scope: tableau:insight_metrics:update
Access Scopes Overview: Cloud
Request Body
{"metric_id"=>"<string>", "specification"=>{"filters"=>[{"field"=>"<string>", "operator"=>"OPERATOR_UNSPECIFIED", "categorical_values"=>[{"string_value"=>"<string>", "bool_value"=>"<boolean>", "null_value"=>"<string>"}, {"string_value"=>"<string>", "bool_value"=>"<boolean>", "null_value"=>"<string>"}]}, {"field"=>"<string>", "operator"=>"OPERATOR_EQUAL", "categorical_values"=>[{"string_value"=>"<string>", "bool_value"=>"<boolean>", "null_value"=>"<string>"}, {"string_value"=>"<string>", "bool_value"=>"<boolean>", "null_value"=>"<string>"}]}], "measurement_period"=>{"granularity"=>"GRANULARITY_UNSPECIFIED", "range"=>"RANGE_UNSPECIFIED"}, "comparison"=>{"comparison"=>"TIME_COMPARISON_PREVIOUS_PERIOD"}}}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
X-Tableau-Auth | string | The Tableau authentication header. The value is a credentials token from a Tableau server's response to an authentication request. | |
The Content-Type and Accept headers should be the mediatype of the request and response except in cases where you want to explicitly allow other versions of the resource. | |||
Content-Type | string | ||
Accept | string |
RESPONSES
status: OK
{"metric":{"id":"\u003cstring\u003e","specification":{"filters":[{"field":"\u003cstring\u003e","operator":"OPERATOR_UNSPECIFIED","categorical_values":[{"string_value":"\u003cstring\u003e","bool_value":"\u003cboolean\u003e","null_value":"\u003cstring\u003e"},{"string_value":"\u003cstring\u003e","bool_value":"\u003cboolean\u003e","null_value":"\u003cstring\u003e"}]},{"field":"\u003cstring\u003e","operator":"OPERATOR_NOT_EQUAL","categorical_values":[{"string_value":"\u003cstring\u003e","bool_value":"\u003cboolean\u003e","null_value":"\u003cstring\u003e"},{"string_value":"\u003cstring\u003e","bool_value":"\u003cboolean\u003e","null_value":"\u003cstring\u003e"}]}],"measurement_period":{"granularity":"GRANULARITY_BY_YEAR","range":"RANGE_LAST_COMPLETE"},"comparison":{"comparison":"TIME_COMPARISON_UNSPECIFIED"}},"definition_id":"\u003cstring\u003e","is_default":"\u003cboolean\u003e","schema_version":"\u003cstring\u003e"}}