Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
microwin88x
Creator III
Creator III

Format Text to Number

Hello,

I have the following values in a field (they are formatted as text, aligned at left in data):

00000000000000026287

00000000000000018306

00000000000000019008

00000000000002726211

00000000000003521228

What I need is to set them like this (taking out the zeros and format them to number):

26287

18306

19008

2726211

3521228

Is there any way to do that?

Thank you!!!

---

Script:

TABLE:

LOAD

TEXT(F1) AS F1_NUM;

LOAD * INLINE [

    F1

     00000000000000026287

     00000000000000018306

     00000000000000019008

     00000000000002726211

     00000000000003521228

];

EXIT SCRIPT

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

Num(Evaluate(FieldName)) as FieldName

View solution in original post

4 Replies
Anil_Babu_Samineni

Can you use Field * 1 ???

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
sunny_talwar

May be try this

Num#(Replace(LTrim(Replace(FieldName, '0', ' ')), ' ', '0')) as FieldName

MK_QSL
MVP
MVP

Num(Evaluate(FieldName)) as FieldName

sunny_talwar

Both works... but yours is much cleaner

TABLE:

LOAD F1,

Num#(Replace(LTrim(Replace(F1, '0', ' ')), ' ', '0')) as F1_Sunny,

Num(Evaluate(F1)) as F1_Manish;

LOAD * INLINE [

    F1

    00000000000000026287

    00000000000000018306

    00000000000000019008

    00000000000002726211

    00000000000003521228

];