SHOW SEMANTIC DIMENSIONS FOR METRIC

statementsupportedAI & ML

docs.snowflake.com ↗

Lists the dimensions that you can return when querying a specific metric in a semantic view. When you specify a dimension and a metric in a semantic view query, the logical table for the dimension must be related to the logical table for the metric. In addition, the logical table for the dimension must have an equal or lower level of granularity than the logical table for the metric. To determine which dimensions meet this criteria, you can run this command. For details, see Choosing the dimensions that you can return for a given metric.

Syntax

SHOW SEMANTIC DIMENSIONS [ LIKE '<pattern>' ]
                         IN <semantic_view_name>
                         FOR METRIC <metric_name>
                         [ STARTS WITH '<name_string>' ]
                         [ LIMIT <rows> ]

Parameters

NameRequiredDescription
LIKE 'pattern'Optionally filters the command output by object name. The filter uses case-insensitive pattern matching, with support for SQL wildcard characters (% and _). For example, the following patterns return the same results: ... LIKE '%testing%' ... ... LIKE '%TESTING%' ... Default: No value (no filtering is applied to the output).
IN semantic_view_nameSpecifies the name of the semantic view containing the dimensions and metric.
FOR METRIC metric_nameSpecifies the name of the metric for which to show associated dimensions.
STARTS WITH 'name_string'Optionally filters the command output based on the characters that appear at the beginning of the object name. The string must be enclosed in single quotes and is case sensitive. For example, the following strings return different results: ... STARTS WITH 'B' ... ... STARTS WITH 'b' ... Default: No value (no filtering is applied to the output)
LIMIT rowsOptionally limits the maximum number of rows returned. The actual number of rows returned might be less than the specified limit. For example, the number of existing objects is less than the specified limit. Default: No value (no limit is applied to the output).

Usage notes

Output

The output of the command includes the following columns, which describe the properties and metadata of the object: Column | Description table_name | Name of the logical table for the dimension. name | Name of the dimension. data_type | Data type of the dimension. required | Indicates whether the dimension is required for the metric. synonyms | Alternative names or synonyms for the dimension. comment | Comment about the dimension.

Access control requirements

A role used to execute this operation must have the following privileges at a minimum: Privilege | Object | Notes Any | Semantic view | Operating on an object in a schema requires at least one privilege on the parent database and at least one privilege on the parent schema. For instructions on creating a custom role with a specified set of privileges, see Creating custom roles. For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.

See also

Referenced by