Returns the absolute (positive) value of a numeric input.
Same as input typeDiperbarui: 13 Jun 2026ABS(expression)Numeric value
1 SELECT 2 value, 3 ABS(value) as absolute 4 FROM UNNEST([-10, 5, -3.5, 0]) as value;
Converts negative values to positive.
| value | absolute |
|---|---|
| -10 | 10 |
| 5 | 5 |
| -3.5 | 3.5 |
| 0 | 0 |
1 SELECT 2 actual, 3 predicted, 4 ABS(actual - predicted) as absolute_error 5 FROM `project.dataset.predictions`;
Calculates absolute error regardless of direction.
Sudah paham ABS? Latih langsung di browser
Latihan interaktif, langsung di browser.