Tabular IQ
Back to Function Index

EMPTY()

Overview

EMPTY() determines if a value is considered empty based on its data type. This function works across all field types and returns TRUE for values that are considered empty according to type-specific rules. It's particularly useful for data validation, filtering, and handling null or empty values in your queries.

Function Format

EMPTY(value)

Return Value

EMPTY() returns a Boolean value (TRUE or FALSE)

Examples


EMPTY("ABC")                    = FALSE  (non-empty string)
EMPTY(DATE(2025, 1, 1))        = FALSE  (valid date)
EMPTY(123)                      = FALSE  (non-zero number)
EMPTY("")                       = TRUE   (empty string)
EMPTY("   ")                    = TRUE   (string with only spaces)
EMPTY(0)                        = TRUE   (zero number)
EMPTY(FALSE)                    = TRUE   (false boolean)
EMPTY(DATE(0, 0, 0))           = TRUE   (empty date)
EMPTY(NULL)                     = TRUE   (null value)

Notes

  • Type-specific empty conditions:
    • Character fields: Returns TRUE for NULL, empty strings (""), or strings containing only spaces
    • Numeric fields: Returns TRUE for NULL or zero (0)
    • Boolean fields: Returns TRUE for NULL or FALSE
    • Date fields: Returns TRUE for NULL or DATE(0,0,0)
  • Common use cases include:
    • Data validation and cleaning
    • Filtering out empty values
    • Conditional logic based on value presence
    • Data quality checks
  • The function can be used with any data type, including:
    • Character strings
    • Numbers
    • Dates
    • Booleans
    • NULL values
  • This function is particularly useful in data cleaning and validation scenarios where you need to identify and handle empty values consistently across different data types.
  • When used in WHERE clauses, it can help filter out records with empty values in specific fields.

See Also