Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
nareshthavidishetty
Creator III
Creator III

Trim zeros

Hi,

I have a field and it has data like 002,003,096,099..

Here i need to remove only zeros.

The final required output would be 2,3,96,99

Field : Location

Thanks..

9 Replies
m_woolf
Master II
Master II

see the replace() string function in Help

albertovarela
Partner - Specialist
Partner - Specialist

Try replace(ltrim(replace(YourField,'0',' ')),' ','0')

Anonymous
Not applicable

You could try this if you field has numbers and letters:

if(isnum(YourField),num(YourField),YourField)

If you're certain the data will always be numeric than you would just need num(YourField)

cmsjamesgreen
Contributor III
Contributor III

Try a combination of Mid() and FindOneOf()

=Mid(Location, FindOneOf(Location, '123456789'))

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Or if you cannot rely on the default masks, you can also use an explicit format that does away with the leading zeroes:

=num(Field, '#0')

jonas_rezende
Specialist
Specialist

Hi, nareshthavidishetty nareshthavidishetty.

Try simply num(Field).

I hope this helps.

MarcoWedel

or maybe

Location*1

hope this helps

regards

Marco

Anil_Babu_Samineni

What is the output you want to see for below Input

Load * Inline [

Location

001

002

300

400

030

099

330

];

Expected output please?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sdmech81
Specialist
Specialist

Hi,

May be try =num(yourfiled)

if doesn't work then plss use like

=Right(yourfield,1)

Sachin