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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Extract the number value from a string in a field

   I have a field "Machine_number" containing values such as "MB01", "MB02", ..., "MB22", now I would like to have the number only, such as "1", "2", ..., "22". This would allow to use it in a ColorMap as argument. Does any one know how to do this?

Cheers,

Jonas

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Try

Load

...

Keepchar(Machine_number, '0123456789') as Machine_number,

..

from Table;

edit

or just use above keepchar() in any chart expression to remove the characters.

edit

View solution in original post

2 Replies
swuehl
MVP
MVP

Try

Load

...

Keepchar(Machine_number, '0123456789') as Machine_number,

..

from Table;

edit

or just use above keepchar() in any chart expression to remove the characters.

edit

Not applicable
Author

Thanks, I was using it as an expression, and used your proposed line directly in the expression:

ColorMapHue(num(KEEPCHAR(Turbine,'0123456789'))/22)

Perfect, thank you,

Jonas