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: 
Anonymous
Not applicable

[resolved] extract year from date type variable

Hello All,
I need to convert Start_Date Column which is date datatype ex: "2012-12-26" to Start_Date_Key as 20121226 INT Datatype.
I can easily do it in SSIS with the expression (YEAR((DT_DBDATE)START_DATE) * 10000) + (MONTH((DT_DBDATE)START_DATE) * 100) +DAY((DT_DBDATE)START_DATE).
How to achieve the above solution in TOS. I tried and no result came.
Please help.
Thanks ---> D
Labels (2)
11 Replies
Anonymous
Not applicable
Author

Hi Steve,
Can you please be more specific? i am new comer to TOS. I don't know where i have to place the above expression whether in tmap or somewhere else?
Thanks--->D
Anonymous
Not applicable
Author

Hi Shong,
I have date column date datatype "03-02-2014" after doing transformation with the  expression TalendDate.getPartOfDate("YEAR", row1.date )*10000 + TalendDate.getPartOfDate("MONTH", row1.date )*100+TalendDate.getPartOfDate("DAY_OF_WEEK", row1.date )
i am getting wrong output 20140201 which is not expected. 
expected one is 20140302.
can you please help?
Thanks---->D