Left-most characters of text
Returns the specified number of characters at the beginning of a textual value. If the number of characters to be returned is greater than the length of the text value or less than 0, returns the text value in its entirety.
Sample usage
LEFT("123 Maple Dr", 5)
returns 123 M
.
LEFT("123 Maple Dr", 0)
returns blank.
First and last initials
Initials from a first and last name:
LEFT([First Name], 1) & LEFT([Last Name], 1)
LEFT(..., 1)
returns the first character of the specified column value.LEFT(...) & LEFT(...)
concatenates the two initials into a single text value.
Equivalent to INITIALS(CONCATENATE([First Name], " ", [Last Name]))
.
See also: CONCATENATE()
, INITIALS()
Integer component of decimal value
The integer component of a Decimal
value in the Result
column:
NUMBER(
LEFT(
TEXT([Result]),
(FIND(".", TEXT([Result])) - 1)
)
)
TEXT([Result])
converts theDecimal
value to aText
value. The textual functions used in this example interpret non-textual values differently. UsingTEXT()
ensures theResult
column value is interpreted the same by each function.(FIND(".", ...) - 1)
locates the character immediately preceding the decimal point.LEFT(..., ...)
extracts the integer part.NUMBER(...)
converts the extracted text to aNumber
.
Equivalent to FLOOR([Result])
.
See also: FIND()
, FLOOR()
, NUMBER()
, TEXT()
Street number from street address
The first word of an address, which is typically the street number:
LEFT([Address], (FIND(" ", [Address]) - 1))
FIND(" ", [Address])
locates the first/leftmost space in the Address column value.FIND(...) - 1
locates the character immediately preceding the first space.LEFT([Address], ...)
returns the leftmost text preceding the first space.
Equivalent to INDEX(SPLIT([Address], " "), 1)
.
See also: FIND()
, INDEX()
, SPLIT()
Syntax
LEFT(text, how-many)
text
- Any textual type.how-many
- Number of characters (Number
) fromtext
to return. Non-Number
values may be accepted but may produce unexpected results.
See Also