Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

mambi
Contributor 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

Re: sting to number convertion

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

6 Replies

Re: sting to number convertion

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

More details would help you get the right answer.

mambi
Contributor III

Re: sting to number convertion

31 920 is 31920 with thousands separator in my excel sheet

MVP
MVP

Re: sting to number convertion

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

Re: sting to number convertion

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
Contributor III

Re: sting to number convertion

Go to properties and check the Override Document Settings

Re: sting to number convertion

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

Community Browser