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

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tMap expression to convert from Upper case to lower

Hello All

I have data as below following example

MANISH

But i need in the result

Manish

I use the function StringHandling.DOWNCASE(row1.Name) that gave me "manish" as an answer. But i need first letter as caps, can some help me in this?

 

Thanks In Advance 

Manish

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

@ksingh 

 

Please try below method

0683p000009M3Od.png

 

0683p000009M3Oi.png

 

The code is as below.

 

row1.data.substring(0,1)

StringHandling.DOWNCASE(row1.data.substring(1,row1.data.length())) 

Please note that you will have to add additional null check conditions for this flow. I am leaving it to you as you are quite familiar with null handling 🙂

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

3 Replies
Anonymous
Not applicable
Author

@ksingh 

 

Please try below method

0683p000009M3Od.png

 

0683p000009M3Oi.png

 

The code is as below.

 

row1.data.substring(0,1)

StringHandling.DOWNCASE(row1.data.substring(1,row1.data.length())) 

Please note that you will have to add additional null check conditions for this flow. I am leaving it to you as you are quite familiar with null handling 🙂

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

Anonymous
Not applicable
Author

Thanks @nthampi

 

That code worked , but i have requirement in some case we will 2 words or more than 2 words in the string, So I need to populate first letter of every word as capital, For that i written on java routine it worked, But am still thinking can we write an expression in tMap.

Please look at the screen shot attached

For to generate first tab result in yellow highlighted i used the Code from which you sent, to generate second tab which is yellow highlighted  i used java routine.

Can you please let me know if we can handle multiple words with a tMap expression to populate first letter as capital and rest as small ?

 

 

0683p000009M3FO.png

 

 

Thanks and Regards

Manish

Anonymous
Not applicable
Author

@ksingh 

 

In this case, a routine is the neat method as you can encapsulate the complex parts within the routine and call just as a function inside tMap.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂