Working with Data: All the calculations you need t
  • Introduction
  • What is this book?
  • How to Use this Book
  • Document Notes
  • Authors' Thanks
  • Strings
    • Concatenate
    • Split
    • Length
    • Slice
    • Trim
    • Contains
    • Match
    • Replace
    • Upper/Lower Case
  • Numbers
    • Sum
    • Average
    • Roll Ups
    • Round
    • Floor
    • Power
    • Square Root
    • Absolute
  • Dates
    • Date Difference
    • Age
  • Logical
    • Logical Operators
    • If
    • Case / Switch
    • Is Null/Empty
  • General
    • Count
    • Filter
    • Sort
    • Lookup/Join
    • Variables
    • Convert Type
  • Appendix
    • DateTime Parts
    • Helpful Resources
Powered by GitBook
On this page
  1. Strings

Length

PreviousSplitNextSlice

Last updated 5 years ago

Was this helpful?

CtrlK
  • Excel
  • Tableau
  • Alteryx
  • OrgVue
  • tSQL
  • Python

Was this helpful?

Length functions allow you to work out how long a text value is, either regarding how many characters it contains, or how many items there are in a list (if it's an array).

This is useful if you want to validate the format of expected values e.g. barcodes, or correctly Slice values apart at specified points.

See also General > Count.

Excel

=~LEN!~(‹cell›)

=LEN(A1) // "ava.wilkins@company.org" -> 23

Tableau

~LEN!~(‹string›)

LEN([Email Address]) // "ava.wilkins@company.org" -> 23

Alteryx

~LEN!~(‹string›)

LEN([Email Address]) // "ava.wilkins@company.org" -> 23

OrgVue

‹dimension›.value.~length!~ OR ‹array›.~length!~

node.emailaddress.value.length 
// "ava.wilkins@company.org" -> 23
// OR
node.c.length // counts the number of items in the array of node.c (ie span of control)

tSQL

~LEN!~(‹field›)

SELECT LEN(EmailAddress) AS EmailLength
FROM EmployeesData

Python

~len!~(‹string›) OR ~len!~(‹array›)

len(emailAddress) # "ava.wilkins@company.org" -> 23
# OR
len(children) # counts the number of items in the array 'children'

NB. The above example assumes variables have been declared for emailAddress and children . For more information, go to General > Variables.