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

put decimal point after two digits

Hi all

i have row in csv which has below data  ,i want to insert decimal point after the starting two digits

i am using Tmap 

number1

12355

23455

26463

35535

Expected:

number1

12.35

23.45

26.46

35.53

 

Thnks 

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi Sushil,

 

     Please add another LEFT function as a quick option to limit the output to first five characters.

 

StringHandling.LEFT(StringHandling.LEFT(row1.input,2)+"."+StringHandling.RIGHT(row1.input,StringHandling.LEN(row1.input)-2),5) 

 

If the solution has helped you, could you please mark the topic as resolved? Kudos are also welcome 🙂

 

Warm Regards,

 

Nikhil Thampi

 

 

View solution in original post

3 Replies
Anonymous
Not applicable

Hi,

 

    Please read the value as string to a tmap and use the below function.

 

StringHandling.LEFT(row1.input,2)+"."+StringHandling.RIGHT(row1.input,StringHandling.LEN(row1.input)-2) 

 

Note:- Please add additional checks to handle NULL and strings whose length are less than 2 if required.

0683p000009LzSO.png

 

 

 

 

Once the conversion is over, you can convert the string to Double if the target is looking for that option.

 

Warm Regards,

 

Nikhil Thampi

 

 

sbxr
Contributor III
Contributor III
Author

@nthampi 

Thank you

But you missed limiting to two digits after decimal point.please check my expected output 

 

Anonymous
Not applicable

Hi Sushil,

 

     Please add another LEFT function as a quick option to limit the output to first five characters.

 

StringHandling.LEFT(StringHandling.LEFT(row1.input,2)+"."+StringHandling.RIGHT(row1.input,StringHandling.LEN(row1.input)-2),5) 

 

If the solution has helped you, could you please mark the topic as resolved? Kudos are also welcome 🙂

 

Warm Regards,

 

Nikhil Thampi