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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
mambi
Creator III
Creator III

sting to number convertion

Hi everyone,

in my select list this number appear as a text : 31 920 (left side)

how to convert it to a number in the load script.

Thanks

1 Solution

Accepted Solutions
Colin-Albert
Partner - Champion
Partner - Champion

Num(replace(number_field, ' ', '')) as number_field

View solution in original post

6 Replies
Colin-Albert
Partner - Champion
Partner - Champion

What number does 31 920 represent?  31920, 31,  920?

More details would help you get the right answer.

mambi
Creator III
Creator III
Author

31 920 is 31920 with thousands separator in my excel sheet

swuehl
MVP
MVP

Just set the correct thousand separator as default in your script or use num#() to parse the string in:

num#('31 920',',',' ')

(assuming ',' as your decimal separator, please check the format codes in the Help for more detail)

Not applicable

There is nothing like string to number conversion because there is only one datatype in QlikView and it's DUAL. In your case I'd just set proper formatting for the field in Document Properties => Number.

It this doesn't work your field can't be interpreted as a numeric value, and you have to do it manually using Num#()

Lukasz

iktrayanov
Creator III
Creator III

Go to properties and check the Override Document Settings

Colin-Albert
Partner - Champion
Partner - Champion

Num(replace(number_field, ' ', '')) as number_field