I guess this is an old thread, but I remove leading zeroes by replacing them with blanks and then using ltrim on load like this:
replace(ltrim(replace(FIELDNAME,'0',' ')),' ','0')
It seems to work and is pretty elegant.
Nice to see you here!. Was looking for a solution to this and found your answer, however I think this won't work for all scenarios.
If I have a material number: 00-001-002, this solution will return -001-002 therefore I enhance a little bit your already elegant solution:
if(purgechar(MATNR,' 0123456789') = '',replace(ltrim(replace(MATNR, '0', ' ')), ' ', 0),MATNR)
I use EVALUATE([FieldName] & '* 1') as replace(ltrim(replace(FIELDNAME,'0',' ')),' ','0') was also removing 0 inside the string, not just leading 0s