Skip to content

abs

abs

🔢 Number

Return the absolute value (magnitude without sign) of a number

abs(number) → number
number

The absolute value of the input number; null if input is null

The abs function returns the absolute value (magnitude without sign) of the input number.

  • If number is null, returns null
  • abs(-0) returns 0
  • abs(0) returns 0
  • Preserves decimal precision: abs(-3.14) returns 3.14
| eval abs_delta = abs(difference)

Creates a new field abs_delta with the absolute value of difference.

| eval error_magnitude = abs(deviation_percent)

Calculates the absolute error in a percentage calculation.

| stats avg(abs(latency_offset))

Calculates the average absolute latency offset.

  • eval — to create or transform numeric fields