What number does each code hold?
Tableau
FLOAT([Code])SQL (DuckDB)
SELECT TRY_CAST(Code AS DOUBLE) AS result
FROM input
ORDER BY id"2.7" becomes 2.7 and "1234567.891" keeps every digit. "abc" and the missing code return null.
| Code | Result |
|---|---|
| 42 | 42 |
| 2.7 | 2.7 |
| -2.5 | −2.5 |
| abc | null |
| 1234567.891 | 1,234,568 |
| null |
The Tableau formula and the SQL return the same 6 rows.