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

Convert String to Int

Hi,

I am trying to convert my String value to an Integer, but not having any luck. The field either has a number, or a NULL.

I have tried the following within TMap, but this doesn't work

 

0695b00000Sq0XzAAJ.png 

Integer.parseInt(row1.comp_number) 

Any idea how to pass this through, please?

Labels (3)
1 Solution

Accepted Solutions
InfoCraft
Creator
Creator

Hi @Steven Littlewood​ ,

try this using tMap or tJavaRow...

row1.comp_number!=null && !row1.comp_number.trim().equals("")? Integer.valueOf(row1.comp_number):null 

 

++++gift

0695b00000Sq0bIAAR.pngSelect as Best if its OK

Kind regards,

😷19.

View solution in original post

2 Replies
InfoCraft
Creator
Creator

Hi @Steven Littlewood​ ,

try this using tMap or tJavaRow...

row1.comp_number!=null && !row1.comp_number.trim().equals("")? Integer.valueOf(row1.comp_number):null 

 

++++gift

0695b00000Sq0bIAAR.pngSelect as Best if its OK

Kind regards,

😷19.

thomas_2583
Contributor III
Contributor III
Author

Thank you so much for your help, that has worked for me. Thank you also for the hint sheet, I am sure this will come in very useful!