You are here: Functions > LEADING()

LEADING()

LEADING() returns a character string containing a specified number of leading digits from a numeric field. Use LEADING() to filter out non-digit elements such as leading zeros (for example, in Zoned numeric data), non-numeric digits and punctuation such as decimals or dollar signs.

LEADING() is primarily intended for use with the Benford command.

Function Format

LEADING(N,#)N

specifies the numeric field
# specifies the number of leading digits to be returned (primarily for use in the Benford command)

Examples

If a numeric field called Amount contains the value $-6,234.56, the value analyzed is:

LEADING(Amount,3) = "623"

LEADING(Amount,5) = "62345"

If a numeric field called Amount contains the value $0.00, the value analyzed is:

LEADING(Amount,3) = "000"

LEADING(Amount,5) = "00000"

If a numeric field called Amount contains the value $3.55, the value analyzed is:

LEADING(Amount,3) = "355"

LEADING(Amount,5) = "35500"