cancel
Showing results for 
Search instead for 
Did you mean: 
intapiuser
Community Team Member
Community Team Member

Question:

What is the best way to remove leading zeros?  I have a field that is alphanumeric values (JONESBJ001, SMITH KC02, 0000012345, 0000555213.
 

Solution:

If all of your data with leading zeros will always be some sort of numerical string (ie there will not be values like 000{character}) you could create a custom column using the following expression in an Elasticube:
 
CASE 
WHEN Left([Values],1) = '0' THEN ToString(ToInt([Values]))
ELSE [Values]
END
Rate this article:
Version history
Last update:
‎11-16-2023 04:23 PM
Updated by: