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

Formatting Issue in removing decimal points

Hi Folks,

 

I have an input file in that the variable data is like below,

3038604370221.23

 

In tMap, the mapping is like below, and for the variable ACCT_LEVEL_1 I want to transform to remove the decimal point. And keep the number as 3038604370221. But when I run the expression like below I am receiving the error as

 

'java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(Unknown Source)
at routines.StringHandling.LEFT(StringHandling.java:229)'

 

Expression:

StringHandling.LEFT(row1.ACCT_LEVEL_1,StringHandling.INDEX(row1.ACCT_LEVEL_1,".")) 

 

0683p000009Ls39.png

Labels (3)
2 Replies
Anonymous
Not applicable
Author

Do all values of ACCT_LEVEL_1 contain a decimal point? If not you will receive this error as StringHandling.INDEX will return -1 if the value is not found.

lojdr
Creator II
Creator II

Hello,

 

What about something like this?0683p000009Lrz8.jpg

 

 

 

Regards

lojdr