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

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

Problems converting Integer to short -- Java

Hello,
I am trying to convert an integer to a "short" value, using following expression in Tmap:
Relational.ISNULL(row22.Hijos)?null:row22.Hijos.equals("null")?null 0683p000009MPcz.pngShort)row22.Hijos
However, I receive message "Cannot convert from Integer to short".
I believe the syntax to be correct, given that the error message reflects what I am trying to do. I can confirm that source field is of type Integer, and target is of type short.
Any ideas as to why this might be happening?
Labels (2)
3 Replies
Anonymous
Not applicable
Author

hi
try shortValue() method !
regards
laurent
Anonymous
Not applicable
Author

Hi Laurent,
That doesn't seem to work,
I tried mapping of "shortValue(row72.CountGrupo)", but received following message:
The method shortValue(Integer) is undefined for the type PhoneData
Any suggestions?
veryimportantdude
Contributor III
Contributor III

try
short(row1.field_name)
or try new BigDecimal(row1.field_name).shortValue()