Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
EvoticTalend
Contributor
Contributor

getCurrentYear in a tMap

Hi everyone

I have a tMap with:

"01/"+row1.month

as VAR1 in the middle, and then is passed to the output

TalendDate.parseDate("dd/MM", Var.VAR1 )

I have days and months but I need THE CURRENT YEAR. ¿ What would be the best option? 

Thank you.

Labels (3)
11 Replies
EvoticTalend
Contributor
Contributor
Author

This code: Var.VAR1 = String.format("%02d",Integer.valueOf(row1.month)) +"-01"

output : Var.VAR2 + "-"+Var.VAR1

pattern of output : "YYYY-MM-DD"

 

Is in string, right?

gjeremy1617088143

sorry you have to parse it as a date :

TalendDate.parseDate("YYY-MM-DD",Var.VAR2 + "-"+Var.VAR1)

pattern of output date schema : "YYYY-MM-DD"

here a link to the sql server doc for date pattern:

https://docs.microsoft.com/en-us/sql/t-sql/functions/date-and-time-data-types-and-functions-transact...