Categories:

Data metric functions

BLANK_PERCENT (system data metric function)

Returns the percentage of column values that are blank for the specified column in a table.

This topic provides the syntax for calling the function directly. To learn how to associate the function with a table or view so it runs at regular intervals, see Associate a DMF.

Syntax

SNOWFLAKE.CORE.BLANK_PERCENT(<query>)

Arguments

query

Specifies a SQL query that projects a single column.

Allowed data types

The column projected by the query must have the VARCHAR data type.

Returns

The function returns a NUMBER value that is the percentage of blank values, from 0 to 100. For example, 1 means that 1% of the values in the column are blank, and 100 means that all of the values are blank.

Example

Measure the percentage of blank fields for the SSN column (US social security number):

SELECT SNOWFLAKE.CORE.BLANK_PERCENT(
  SELECT
    ssn
  FROM hr.tables.empl_info
);
+-------------------------------------------------------------------+
| SNOWFLAKE.CORE.BLANK_PERCENT(SELECT ssn FROM hr.tables.empl_info) |
+-------------------------------------------------------------------+
| 1                                                                 |
+-------------------------------------------------------------------+