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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

cast long to integer in tMap

How would I cast a long to an integer in a tMap? (ignoring the possibilities of overflows)
Looking at https://community.talend.com/t5/Design-and-Development/Casting-Short-to-Integer/td-p/94576, I tried this:
new Integer(order_lines.order_id) as my expression, but got an error "The constructor Integer(long) is undefined".
I also looked at https://community.talend.com/t5/Design-and-Development/Int-to-Date/td-p/62918 (string -> int -> date) and https://community.talend.com/t5/Design-and-Development/resolved-cast-type-of-key-from-NVARCHAR-to-IN... (string -> int), and many Stack Overflow topics
Java is YALTL (Yet Another Language To Learn) for me... Thanks, Sonia.
Labels (3)
3 Replies
Anonymous
Not applicable
Author

If it's an Object, you could use mylnteger.intValue().
As you say, ignoring the fact that the value may be too large
Anonymous
Not applicable
Author

Thanks I'll give that a go.
PS I like your "ByExample" site.
_AnonymousUser
Specialist III
Specialist III

If it's an Object, you could use mylnteger.intValue().
As you say, ignoring the fact that the value may be too large