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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
JM39
Creator
Creator

How to use if/else in tMap

hello, I've had a look around and can't find the answer to my specific issue.  

 

I have some source data where one of the columns contains a number which can typically be either one, two or three characters.  In the output I want all those values to be six characters long.  So if the source contains two, I want to add four leading zeros, if the source contains three, I want to add three leading zeros, etc.  I'm not sure how to do this?

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable

1 Reply
Anonymous
Not applicable

Hi
Take a look at this topic, it provides Java expression to do it.
https://community.talend.com/t5/Design-and-Development/Left-Padding-Integer-With-Zeroes/m-p/75891#M3...

Regards
Shong