CHAR_LENGTH / CHARACTER_LENGTH

Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API

Returns the number of characters in a string.

Syntax 

1char_length(<string>)
2character_length(<string>)

Arguments 

Required 

  • <string>: The string to measure.

Returns 

Returns an integer representing the number of characters in the string.

Considerations 

  • Counts characters, not bytes (important for multi-byte UTF-8 characters).
  • The char_length and character_length functions are equivalent.

Examples 

Count Characters 

Get the character count of a string.

1SELECT char_length('jose') AS result;

Returns 4.

Related Documentation 

DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!