Skip to main content
Question

try_get_unit udf cannot resolve dimensionless:unitless unit

  • November 24, 2025
  • 1 reply
  • 30 views

Marwen TALEB
MVP

Hello, 

Although “unitless” is an alias of the dimensionless:unitless unit, try_get_unit(“unitless”) returns null.

ref: https://github.com/cognitedata/units-catalog/blob/main/versions/v1/units.json#L1699

 

Could you please have a look?

 

Thanks!

1 reply

Everton Colling
Seasoned Practitioner
Forum|alt.badge.img
  • Seasoned Practitioner
  • November 25, 2025

Hi ​@Marwen TALEB!

There are currently two units from different quantities that possess the alias "unitless". When using the try_get_unit UDF, if the function encounters more than one unit, it returns null due to the ambiguity.

That being said, you can add "Dimensionless" or "Dimensionless Ratio" as a 2nd argument (quantity) to try_get_unit to circumvent the ambiguity, and that will return the associated unit, as the catalog enforces unique aliases within a quantity, but not across quantities.