Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Converting a month.num to month.text

Can anyone help!

I want to load a date field which is in the excel file as "period" in the following concatenated format YYYYMM eg. 201306

I've split this into Month and Year as follows:

LOAD

left(PERIOD, 4) AS "Year",

right(PERIOD, 2) AS "Month",

How  do I convert the numeric month into a text month within the load statement

 

does a switch case type statement work or is there a function to convert this?

Please give examples!

1 Solution

Accepted Solutions
jerem1234
Specialist II
Specialist II

Maybe try something like:

Year(Date#(PERIOD, 'YYYYMM')) as "Year"

e.g. for 201306 will return "2013"

Month(Date#(PERIOD, 'YYYYMM')) as "Month"

e.g. for 201306 will return "Jun"

View solution in original post

2 Replies
jerem1234
Specialist II
Specialist II

Maybe try something like:

Year(Date#(PERIOD, 'YYYYMM')) as "Year"

e.g. for 201306 will return "2013"

Month(Date#(PERIOD, 'YYYYMM')) as "Month"

e.g. for 201306 will return "Jun"

Not applicable
Author

Excellent, that worked perfectly.  My thoughts were heading in the right direction but weren't concluding in anything as efficient as this.

Thanks alot for your help!