cancel
Showing results for 
Search instead for 
Did you mean: 
Community_Admin
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.

Answer

If all of your data with leading zeros will always be some sort of numerical string (i.e. there will not be values like 000{character}) you could create a custom column using the following expression in the ElastiCube:

Community_Admin_0-1634390116642.png

Here is the SQL code you can use:

CASE 

WHEN Left([Values],1) = '0' THEN ToString(ToInt([Values]))

ELSE [Values]

END



Version history
Last update:
‎10-16-2021 06:16 AM
Updated by:
Contributors
Community Toolbox

Recommended quick links to assist you in optimizing your community experience:

Need additional support?:

Community Support Request