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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] StringHandling function in tMap

Is there a way that I can use the StringHandling function from tMap in other place?
For example,
I've got this expression typed in tFileCopy, basic settings -> rename -> destination filename
StringHandling.LEFT(globalMap.get("FILE_NAME"),(StringHandling.LEN(globalMap.get("FILE_NAME"))-4))+"_"+TalendDate.getCurrentDate()+".jpg"
But it returned error sort like "LEN in StringHandling method not applicable". While the TalendDate function works here.
I used the similar string in tMap
StringHandling.LEFT(row1.FILE_NAME),(StringHandling.LEN(row1.FILE_NAME)-4))+"_"+TalendDate.getCurrentDate()+".jpg" and it works.
I wonder since I'm able to use TalendDate I could also use other functions. Could any tell me if I've got the wrong understanding or I put it in the wrong way?
Thanks!
Labels (2)
1 Solution

Accepted Solutions
alevy
Specialist
Specialist

You need to preface globalMap.get with the variable type in brackets. Also, getCurrentDate returns a Date not a String. So:
StringHandling.LEFT((String)globalMap.get("FILE_NAME"),(StringHandling.LEN((String)globalMap.get("FILE_NAME"))-4))+"_"+TalendDate.getDate("yyyyMMdd")+".jpg"

View solution in original post

2 Replies
alevy
Specialist
Specialist

You need to preface globalMap.get with the variable type in brackets. Also, getCurrentDate returns a Date not a String. So:
StringHandling.LEFT((String)globalMap.get("FILE_NAME"),(StringHandling.LEN((String)globalMap.get("FILE_NAME"))-4))+"_"+TalendDate.getDate("yyyyMMdd")+".jpg"
Anonymous
Not applicable
Author

THANKS!!!