Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Convert from double to integer

my source is a flat file ,data has value which may or maynot be a decimal (eg.12345.89 or 3456),we want only the integer part of it and not the decimal part of it(eg 12345 and not 12345.89)
I am creating a variable ,
StringHandling.INDEX(row1.id,".") == -1 ? StringHandling.LEN(row1.id) : StringHandling.INDEX(row1.id,".")
and another variable ,
Integer.parseInt(StringHandling.LEFT(row1.id,Var.index))
It is working fine and i am getting the required output,but i still want to know if there is any other better way for resolving this requirement
Thanks in advance,
Amk
Labels (2)
2 Replies
Anonymous
Not applicable
Author

Hi,
I think you can use this :
Double.parseDouble(row1.id).intValue()

Regards,
Lie
Anonymous
Not applicable
Author

Thank you Lie,I will try and get back to you...
Regards,
Amk