System data metric functions

This topic is a reference for the system data metric functions (DMFs) that Snowflake provides to all accounts. DMFs are the building block of data quality checks.

About system DMFs

Snowflake provides system DMFs in the CORE schema of the shared SNOWFLAKE database. System DMFs are maintained by Snowflake; you cannot change the name or functionality of any system DMF.

Each system DMF enables you to measure a different data quality attribute. You can assign more than one system DMF to a table or view to allow for a more comprehensive data quality measurement to address your governance and compliance needs.

The Statistics DMFs return a measurement rather than a pass or fail signal. You define the expectation that determines whether a given value indicates a problem. The Outliers DMFs apply a built-in threshold, such as Tukey fences or a Z-score cutoff, and return the number or percentage of values that fall outside it.

The Machine Learning DMFs compare a column of predicted values with a column of actual values, for example, to monitor the output of a machine learning model. Specify the predicted column first when you associate one of these DMFs with a table or view.

Many count and percentage DMFs measure undesirable values, so lower values are better. Other DMFs, such as NOT_NULL_COUNT, measure values that meet an expectation. The ROWS_IN_PAST DMFs in the Volume category count values in a trailing window that ends at the scheduled evaluation time; a value of 0 means that no data arrived.

System DMFs

Currently, Snowflake supports these system DMFs to measure common metrics without having to define them:

CategorySystem DMFDescription
CompletenessALL_SPACE_COUNTDetermine how many non-NULL values in a string column are not empty but contain only whitespace.
ALL_SPACE_PERCENTDetermine what percentage of values in a string column are not empty but contain only whitespace.
BLANK_COUNTDetermine how many blank values are in a column.
BLANK_PERCENTDetermine what percentage of a column’s values are blank.
EMPTY_STRING_COUNTDetermine how many empty strings are in a column.
EMPTY_STRING_PERCENTDetermine what percentage of a column’s values are empty strings.
NOT_NULL_COUNTDetermine how many non-NULL values are in a column.
NOT_NULL_PERCENTDetermine what percentage of a column’s values are not NULL.
NULL_COUNTDetermine how many NULL values are in a column.
NULL_KEYWORD_COUNTDetermine how many non-NULL values in a string column are a text placeholder for a missing value.
NULL_KEYWORD_PERCENTDetermine what percentage of values in a string column are a text placeholder for a missing value.
NULL_PERCENTDetermine what percentage of a column’s values are NULL.
ConsistencyCASE_FORMAT_VIOLATION_COUNTDetermine how many non-NULL values in a string column have inconsistent casing (not all-uppercase, all-lowercase, or title-case).
CASE_FORMAT_VIOLATION_PERCENTDetermine what percentage of non-NULL values in a string column have inconsistent casing.
CONTAINS_SPACES_COUNTDetermine how many non-NULL values in a string column contain a space, tab, or no-break space.
CONTAINS_SPACES_PERCENTDetermine what percentage of values in a string column contain a space, tab, or no-break space.
SPECIAL_CHARACTER_COUNTDetermine how many non-NULL values in a string column contain characters outside the alphanumeric range.
SPECIAL_CHARACTER_PERCENTDetermine what percentage of non-NULL values in a string column contain characters outside the alphanumeric range.
UNTRIMMED_STRING_COUNTDetermine how many non-NULL values in a string column have leading or trailing whitespace.
UNTRIMMED_STRING_PERCENTDetermine what percentage of non-NULL values in a string column have leading or trailing whitespace.
FreshnessFRESHNESSDetermine the freshness of a table’s data based on a timestamp column or the most recent DML operation.
SOURCE_TARGET_LAGDetermine how far, in seconds, the latest timestamp in a target table trails the latest timestamp in a source table.
Machine LearningACCURACYDetermine what percentage of predicted values in a column are equal to the actual values in another column.
MAEDetermine the mean absolute error between a column of predicted values and a column of actual values.
MAPEDetermine the mean absolute percentage error between a column of predicted values and a column of actual values.
MEAN_ERRORDetermine whether a column of predicted values is, on average, higher or lower than a column of actual values.
R_SQUAREDDetermine the coefficient of determination (R²) of a column of predicted values against a column of actual values.
RMSEDetermine the root mean squared error between a column of predicted values and a column of actual values.
OutliersEXTREME_OUTLIER_COUNTDetermine how many non-NULL values in a numeric column fall outside the extreme asymmetric Tukey fences for the column.
EXTREME_OUTLIER_IQR_COUNTDetermine how many non-NULL values in a numeric column fall outside the extreme Tukey fences (3 times the interquartile range).
EXTREME_OUTLIER_IQR_PERCENTDetermine what percentage of values in a numeric column fall outside the extreme Tukey fences (3 times the interquartile range).
EXTREME_OUTLIER_PERCENTDetermine what percentage of values in a numeric column fall outside the extreme asymmetric Tukey fences for the column.
EXTREME_OUTLIER_ZSCORE_COUNTDetermine how many non-NULL values in a numeric column have a Z-score greater than 4.5.
EXTREME_OUTLIER_ZSCORE_PERCENTDetermine what percentage of values in a numeric column have a Z-score greater than 4.5.
OUTLIER_COUNTDetermine how many non-NULL values in a numeric column fall outside the asymmetric Tukey fences for the column.
OUTLIER_IQR_COUNTDetermine how many non-NULL values in a numeric column fall outside the standard Tukey fences (1.5 times the interquartile range).
OUTLIER_IQR_PERCENTDetermine what percentage of values in a numeric column fall outside the standard Tukey fences (1.5 times the interquartile range).
OUTLIER_PERCENTDetermine what percentage of values in a numeric column fall outside the asymmetric Tukey fences for the column.
OUTLIER_ZSCORE_COUNTDetermine how many non-NULL values in a numeric column have a Z-score greater than 3.
OUTLIER_ZSCORE_PERCENTDetermine what percentage of values in a numeric column have a Z-score greater than 3.
SchemaSCHEMA_CHANGE_ADD_COUNTCount columns added between consecutive evaluations.
SCHEMA_CHANGE_COUNTCount schema changes (column add, drop, rename, or type change) detected between consecutive evaluations.
SCHEMA_CHANGE_DROP_COUNTCount columns dropped between consecutive evaluations.
SCHEMA_CHANGE_TYPE_COUNTCount columns whose data type changed between consecutive evaluations.
StatisticsAPPROX_QUANTILE_20Determine the approximate 20th percentile value for a numeric column.
APPROX_QUANTILE_25Determine the approximate 25th percentile value for a numeric column.
APPROX_QUANTILE_40Determine the approximate 40th percentile value for a numeric column.
APPROX_QUANTILE_50Determine the approximate 50th percentile (median) value for a numeric column.
APPROX_QUANTILE_60Determine the approximate 60th percentile value for a numeric column.
APPROX_QUANTILE_80Determine the approximate 80th percentile value for a numeric column.
APPROX_QUANTILE_95Determine the approximate 95th percentile value for a numeric column.
APPROX_QUANTILE_99Determine the approximate 99th percentile value for a numeric column.
AVGDetermine the average value of a column.
FALSE_COUNTDetermine how many non-NULL values in a Boolean column are FALSE.
FALSE_PERCENTDetermine what percentage of values in a Boolean column are FALSE.
GEOMETRIC_MEANDetermine the geometric mean of the positive values in a numeric column.
HARMONIC_MEANDetermine the harmonic mean of the nonzero values in a numeric column.
KURTOSISDetermine the sample excess kurtosis of the values in a numeric column.
MAXDetermine the maximum value of a column.
MEDIANDetermine the exact median value for a numeric column.
MINDetermine the minimum value of a column.
NEGATIVE_COUNTDetermine how many non-NULL values in a numeric column are negative.
NEGATIVE_PERCENTDetermine what percentage of values in a numeric column are negative.
SKEWDetermine the sample skewness of the values in a numeric column.
STDDEVDetermine the standard deviation value for a column.
STRING_LENGTH_AVGDetermine the average string length of non-NULL values for a string column.
STRING_LENGTH_MAXDetermine the maximum string length of non-NULL values for a string column.
STRING_LENGTH_MINDetermine the minimum string length of non-NULL values for a string column.
STRING_LENGTH_STDDEVDetermine the sample standard deviation of the string length of non-NULL values for a string column.
SUMDetermine the sum of the values in a numeric column.
TRUE_COUNTDetermine how many non-NULL values in a Boolean column are TRUE.
TRUE_PERCENTDetermine what percentage of values in a Boolean column are TRUE.
VARIANCEDetermine the variance value for a numeric column.
ZERO_COUNTDetermine how many non-NULL values in a numeric column are equal to zero.
ZERO_PERCENTDetermine what percentage of values in a numeric column are equal to zero.
UniquenessDUPLICATE_COUNTDetermine the number of duplicate values in a column, including NULL values.
DUPLICATE_PERCENTDetermine what percentage of non-NULL rows have a value that occurs more than once.
UNIQUE_COUNTDetermine the number of unique, non-NULL values in a column.
UNIQUE_PERCENTDetermine what percentage of non-NULL rows have a value that occurs exactly once.
ValidityACCEPTED_VALUESDetermine whether values in a column match a Boolean expression.
FUTURE_TIMESTAMP_COUNTDetermine how many non-NULL values in a date/timestamp column are in the future relative to the scheduled evaluation time.
FUTURE_TIMESTAMP_PERCENTDetermine what percentage of values in a date/timestamp column are in the future relative to the scheduled evaluation time.
INVALID_CA_POSTAL_CODE_COUNTDetermine how many non-NULL values in a string column are not a valid Canadian postal code.
INVALID_CA_POSTAL_CODE_PERCENTDetermine what percentage of values in a string column are not a valid Canadian postal code.
INVALID_CA_SIN_COUNTDetermine how many non-NULL values in a string column are not a valid Canadian Social Insurance Number.
INVALID_CA_SIN_PERCENTDetermine what percentage of values in a string column are not a valid Canadian Social Insurance Number.
INVALID_CH_OASI_COUNTDetermine how many non-NULL values in a string column are not a valid Swiss OASI number.
INVALID_CH_OASI_PERCENTDetermine what percentage of values in a string column are not a valid Swiss OASI number.
INVALID_CUSIP_COUNTDetermine how many non-NULL values in a string column are not a valid CUSIP.
INVALID_CUSIP_PERCENTDetermine what percentage of values in a string column are not a valid CUSIP.
INVALID_DE_POSTAL_CODE_COUNTDetermine how many non-NULL values in a string column are not a valid German postal code.
INVALID_DE_POSTAL_CODE_PERCENTDetermine what percentage of values in a string column are not a valid German postal code.
INVALID_DE_TAX_ID_COUNTDetermine how many non-NULL values in a string column are not a valid German tax identification number.
INVALID_DE_TAX_ID_PERCENTDetermine what percentage of values in a string column are not a valid German tax identification number.
INVALID_EMAIL_COUNTDetermine how many non-NULL values in a string column are not a valid email address.
INVALID_EMAIL_PERCENTDetermine what percentage of values in a string column are not a valid email address.
INVALID_ES_DNI_COUNTDetermine how many non-NULL values in a string column are not a valid Spanish DNI number.
INVALID_ES_DNI_PERCENTDetermine what percentage of values in a string column are not a valid Spanish DNI number.
INVALID_FIGI_COUNTDetermine how many non-NULL values in a string column are not a valid FIGI.
INVALID_FIGI_PERCENTDetermine what percentage of values in a string column are not a valid FIGI.
INVALID_FR_INSEE_CODE_COUNTDetermine how many non-NULL values in a string column are not a valid French INSEE commune code.
INVALID_FR_INSEE_CODE_PERCENTDetermine what percentage of values in a string column are not a valid French INSEE commune code.
INVALID_FR_POSTAL_CODE_COUNTDetermine how many non-NULL values in a string column are not a valid French postal code.
INVALID_FR_POSTAL_CODE_PERCENTDetermine what percentage of values in a string column are not a valid French postal code.
INVALID_INTEGER_COUNTDetermine how many non-NULL values in a string column are not an integer.
INVALID_INTEGER_PERCENTDetermine what percentage of values in a string column are not an integer.
INVALID_ISIN_COUNTDetermine how many non-NULL values in a string column are not a valid ISIN.
INVALID_ISIN_PERCENTDetermine what percentage of values in a string column are not a valid ISIN.
INVALID_ISO8601_FORMAT_COUNTDetermine how many non-NULL values in a string column are not in ISO 8601 layout.
INVALID_ISO8601_FORMAT_PERCENTDetermine what percentage of values in a string column are not in ISO 8601 layout.
INVALID_IT_FISCAL_CODE_COUNTDetermine how many non-NULL values in a string column are not a valid Italian fiscal code.
INVALID_IT_FISCAL_CODE_PERCENTDetermine what percentage of values in a string column are not a valid Italian fiscal code.
INVALID_JSON_COUNTDetermine how many non-NULL values in a string column are not valid JSON.
INVALID_JSON_PERCENTDetermine what percentage of non-NULL values in a string column are not valid JSON.
INVALID_LATITUDE_COUNTDetermine how many non-NULL values in a numeric column are outside the valid latitude range (-90 to 90).
INVALID_LATITUDE_PERCENTDetermine what percentage of values in a numeric column are outside the valid latitude range (-90 to 90).
INVALID_LEI_COUNTDetermine how many non-NULL values in a string column are not a valid LEI.
INVALID_LEI_PERCENTDetermine what percentage of values in a string column are not a valid LEI.
INVALID_LONGITUDE_COUNTDetermine how many non-NULL values in a numeric column are outside the valid longitude range (-180 to 180).
INVALID_LONGITUDE_PERCENTDetermine what percentage of values in a numeric column are outside the valid longitude range (-180 to 180).
INVALID_NL_BSN_COUNTDetermine how many non-NULL values in a string column are not a valid Dutch citizen service number.
INVALID_NL_BSN_PERCENTDetermine what percentage of values in a string column are not a valid Dutch citizen service number.
INVALID_NUMERIC_TYPE_CAST_COUNTDetermine how many non-NULL values in a string column cannot be parsed as numeric.
INVALID_NUMERIC_TYPE_CAST_PERCENTDetermine what percentage of non-NULL values in a string column cannot be parsed as numeric.
INVALID_PERCENTAGE_RANGE_COUNTDetermine how many non-NULL values in a numeric column are outside the range 0 to 100.
INVALID_PERCENTAGE_RANGE_PERCENTDetermine what percentage of values in a numeric column are outside the range 0 to 100.
INVALID_PERM_ID_COUNTDetermine how many non-NULL values in a string column are not a valid PermID.
INVALID_PERM_ID_PERCENTDetermine what percentage of values in a string column are not a valid PermID.
INVALID_PL_PESEL_COUNTDetermine how many non-NULL values in a string column are not a valid Polish PESEL number.
INVALID_PL_PESEL_PERCENTDetermine what percentage of values in a string column are not a valid Polish PESEL number.
INVALID_PROBABILITY_RANGE_COUNTDetermine how many non-NULL values in a numeric column are outside the range 0 to 1.
INVALID_PROBABILITY_RANGE_PERCENTDetermine what percentage of values in a numeric column are outside the range 0 to 1.
INVALID_SEDOL_COUNTDetermine how many non-NULL values in a string column are not a valid SEDOL.
INVALID_SEDOL_PERCENTDetermine what percentage of values in a string column are not a valid SEDOL.
INVALID_TIMESTAMP_STRING_COUNTDetermine how many non-NULL values in a string column can’t be parsed as a timestamp or date.
INVALID_TIMESTAMP_STRING_PERCENTDetermine what percentage of values in a string column can’t be parsed as a timestamp or date.
INVALID_TR_ID_NO_COUNTDetermine how many non-NULL values in a string column are not a valid Turkish national identification number.
INVALID_TR_ID_NO_PERCENTDetermine what percentage of values in a string column are not a valid Turkish national identification number.
INVALID_UK_NINO_COUNTDetermine how many non-NULL values in a string column are not a valid UK National Insurance number.
INVALID_UK_NINO_PERCENTDetermine what percentage of values in a string column are not a valid UK National Insurance number.
INVALID_UK_POSTAL_CODE_COUNTDetermine how many non-NULL values in a string column are not a valid UK postcode.
INVALID_UK_POSTAL_CODE_PERCENTDetermine what percentage of values in a string column are not a valid UK postcode.
INVALID_USA_PHONE_COUNTDetermine how many non-NULL values in a string column are not a valid U.S. phone number.
INVALID_USA_PHONE_PERCENTDetermine what percentage of values in a string column are not a valid U.S. phone number.
INVALID_USA_STATE_CODE_COUNTDetermine how many non-NULL values in a string column are not a valid U.S. state code.
INVALID_USA_STATE_CODE_PERCENTDetermine what percentage of values in a string column are not a valid U.S. state code.
INVALID_USA_ZIP_CODE_COUNTDetermine how many non-NULL values in a string column are not a valid U.S. ZIP Code.
INVALID_USA_ZIP_CODE_PERCENTDetermine what percentage of values in a string column are not a valid U.S. ZIP Code.
INVALID_UUID_COUNTDetermine how many non-NULL values in a string column are not a valid UUID.
INVALID_UUID_PERCENTDetermine what percentage of values in a string column are not a valid UUID.
NAN_COUNTDetermine how many non-NULL values in a numeric or string column are NaN.
NAN_PERCENTDetermine what percentage of values in a numeric or string column are NaN.
NOT_FRIDAY_COUNTDetermine how many non-NULL values in a date/timestamp column don’t fall on a Friday.
NOT_FRIDAY_PERCENTDetermine what percentage of values in a date/timestamp column don’t fall on a Friday.
NOT_IN_FUTURE_COUNTDetermine how many non-NULL values in a date/timestamp column are not in the future relative to the scheduled evaluation time.
NOT_IN_FUTURE_PERCENTDetermine what percentage of values in a date/timestamp column are not in the future relative to the scheduled evaluation time.
NOT_MONDAY_COUNTDetermine how many non-NULL values in a date/timestamp column don’t fall on a Monday.
NOT_MONDAY_PERCENTDetermine what percentage of values in a date/timestamp column don’t fall on a Monday.
NOT_SATURDAY_COUNTDetermine how many non-NULL values in a date/timestamp column don’t fall on a Saturday.
NOT_SATURDAY_PERCENTDetermine what percentage of values in a date/timestamp column don’t fall on a Saturday.
NOT_SUNDAY_COUNTDetermine how many non-NULL values in a date/timestamp column don’t fall on a Sunday.
NOT_SUNDAY_PERCENTDetermine what percentage of values in a date/timestamp column don’t fall on a Sunday.
NOT_THURSDAY_COUNTDetermine how many non-NULL values in a date/timestamp column don’t fall on a Thursday.
NOT_THURSDAY_PERCENTDetermine what percentage of values in a date/timestamp column don’t fall on a Thursday.
NOT_TODAY_COUNTDetermine how many non-NULL values in a date/timestamp column aren’t on the date of the scheduled evaluation time.
NOT_TODAY_PERCENTDetermine what percentage of values in a date/timestamp column aren’t on the date of the scheduled evaluation time.
NOT_TUESDAY_COUNTDetermine how many non-NULL values in a date/timestamp column don’t fall on a Tuesday.
NOT_TUESDAY_PERCENTDetermine what percentage of values in a date/timestamp column don’t fall on a Tuesday.
NOT_WEDNESDAY_COUNTDetermine how many non-NULL values in a date/timestamp column don’t fall on a Wednesday.
NOT_WEDNESDAY_PERCENTDetermine what percentage of values in a date/timestamp column don’t fall on a Wednesday.
NOT_WEEKDAY_COUNTDetermine how many non-NULL values in a date/timestamp column fall on a Saturday or a Sunday.
NOT_WEEKDAY_PERCENTDetermine what percentage of values in a date/timestamp column fall on a Saturday or a Sunday.
NOT_YESTERDAY_COUNTDetermine how many non-NULL values in a date/timestamp column aren’t on the day before the date of the scheduled evaluation time.
NOT_YESTERDAY_PERCENTDetermine what percentage of values in a date/timestamp column aren’t on the day before the date of the scheduled evaluation time.
REFERENTIAL_INTEGRITY_COUNTDetermine how many source rows have non-NULL column values that don’t match a row in the referenced table.
UNIX_ZERO_COUNTDetermine how many non-NULL values in a date/timestamp column are equal to the Unix epoch (1970-01-01).
UNIX_ZERO_PERCENTDetermine what percentage of values in a date/timestamp column are equal to the Unix epoch (1970-01-01).
VolumeROW_COUNTDetermine how many records are in the table or view.
ROWS_IN_PAST_DAY_COUNTDetermine how many non-NULL values in a timestamp column fall in the 24 hours before the scheduled evaluation time.
ROWS_IN_PAST_DAY_PERCENTDetermine what percentage of values in a timestamp column fall in the 24 hours before the scheduled evaluation time.
ROWS_IN_PAST_HOUR_COUNTDetermine how many non-NULL values in a timestamp column fall in the hour before the scheduled evaluation time.
ROWS_IN_PAST_HOUR_PERCENTDetermine what percentage of values in a timestamp column fall in the hour before the scheduled evaluation time.
ROWS_IN_PAST_MONTH_COUNTDetermine how many non-NULL values in a date/timestamp column fall in the 30 days before the scheduled evaluation time.
ROWS_IN_PAST_MONTH_PERCENTDetermine what percentage of values in a date/timestamp column fall in the 30 days before the scheduled evaluation time.
ROWS_IN_PAST_WEEK_COUNTDetermine how many non-NULL values in a date/timestamp column fall in the 7 days before the scheduled evaluation time.
ROWS_IN_PAST_WEEK_PERCENTDetermine what percentage of values in a date/timestamp column fall in the 7 days before the scheduled evaluation time.
ROWS_IN_PAST_YEAR_COUNTDetermine how many non-NULL values in a date/timestamp column fall in the 365 days before the scheduled evaluation time.
ROWS_IN_PAST_YEAR_PERCENTDetermine what percentage of values in a date/timestamp column fall in the 365 days before the scheduled evaluation time.
TABLE_SIZE_BYTESDetermine the logical size of a table, in bytes.

Some system DMFs measure closely related conditions:

  • NULL_COUNT and NOT_NULL_COUNT are complements: together they count every row. The same is true of NULL_PERCENT and NOT_NULL_PERCENT.
  • BLANK_COUNT counts values that are empty or contain only spaces, such as '' and ' '. EMPTY_STRING_COUNT counts only the empty string ''. Neither function counts NULL values.
  • FUTURE_TIMESTAMP_COUNT counts values that are later than the scheduled evaluation time, and NOT_IN_FUTURE_COUNT counts values that are at or before it. Neither function counts NULL values, so together they count every non-NULL value.
  • DUPLICATE_PERCENT returns the percentage of non-NULL rows whose value occurs more than once, and UNIQUE_PERCENT returns the percentage whose value occurs exactly once. Both exclude NULL values, so together they add up to 100 when the column has a non-NULL value.
  • ALL_SPACE_COUNT counts non-empty values that contain only whitespace, including tabs, line breaks, and no-break spaces. Unlike BLANK_COUNT, it doesn’t count the empty string ''.
  • CONTAINS_SPACES_COUNT counts values that contain a space, tab, or no-break space anywhere, and UNTRIMMED_STRING_COUNT counts only values with leading or trailing whitespace.
  • INVALID_ISO8601_FORMAT_COUNT checks only the layout of a value, and INVALID_TIMESTAMP_STRING_COUNT checks whether the value can be parsed as a timestamp. For example, 2026-13-45 has a valid ISO 8601 layout but can’t be parsed.
  • INVALID_INTEGER_COUNT counts values that aren’t written as a integer, and INVALID_NUMERIC_TYPE_CAST_COUNT counts values that can’t be cast to a number. For example, 3.7 is counted by INVALID_INTEGER_COUNT but not by INVALID_NUMERIC_TYPE_CAST_COUNT.
  • TRUE_PERCENT, FALSE_PERCENT, and NULL_PERCENT add up to 100 for a Boolean column that has at least one row.
  • SCHEMA_CHANGE_ADD_COUNT, SCHEMA_CHANGE_DROP_COUNT, and SCHEMA_CHANGE_TYPE_COUNT each count one kind of change that SCHEMA_CHANGE_COUNT also counts. Renamed columns are counted only by SCHEMA_CHANGE_COUNT.
  • FRESHNESS measures how long ago a single table was last updated, and SOURCE_TARGET_LAG measures how far the latest timestamp in a target table trails the latest timestamp in a source table.

DATA_METRIC_SCHEDULED_TIME isn’t a metric and you can’t associate it with a table or view. Call it in the body of a custom DMF to retrieve the scheduled evaluation time, for example to define a custom freshness metric.