Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
HarshChachara
Contributor
Contributor

Convert text to number

I receive numbers in a format such as '000000000451'

 I am looking to convert the above to numbers i.e. 451

 

I have tried using Num(), Num#(), Evaluate() but can't seem to get it working.

Could you please advice?

1 Solution

Accepted Solutions
martinpohl
Partner - Master
Partner - Master

there's a tricky workaround

replace(ltrim(replace(Yourfield,'0',' ')),' ','0')

-> replace all 0 with space

-> delete all left spaces

-> replace all spaces with 0

000467 -> 467

Regards

View solution in original post

2 Replies
martinpohl
Partner - Master
Partner - Master

there's a tricky workaround

replace(ltrim(replace(Yourfield,'0',' ')),' ','0')

-> replace all 0 with space

-> delete all left spaces

-> replace all spaces with 0

000467 -> 467

Regards

HarshChachara
Contributor
Contributor
Author

Yes! Thank you very much. I adopted that solution and used the replace() to change the hyphen in negative numbers as well.