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: 
Anonymous
Not applicable

Error converting data type nvarchar to float.

I am trying to convert a string ( 1223.00) to float in tmap, but it's giving me an error "Error converting datatype nvarchar to float.

 

I tried the following :

Float.valueOf(row1.field1), still it won't run.

 

I also tried

row1.field1!= null ? row1.field1.doubleValue() : null

It says "the method doubleValue is undefined for the type String.

 

Can someone help me with this?

Labels (1)
3 Replies
vboppudi
Partner - Creator III
Partner - Creator III

Please try below.

 

0683p000009LzEJ.png

 

Regards,

iamabhishek
Creator III
Creator III

@Gohan - you need to use parseFloat(),  valueOf() returns a Float (object) and parseFloat() returns float number.

Code - 

Float.parseFloat(row1.field1) 

 

Anonymous
Not applicable
Author

0683p000009LyLV.png