Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Concatenate Month & Year to Single Date Field

Hi

I want to create a single date field in my script data which combines 2 fields together:

Finance_Month (January, February, March, April, May, June, July, August, September, October, November, December)

Finance_Year (2015, 2016, 2017)

I want to combine them to return the following in a date format

April 2015, May 2015, June 2015 July 2015 ........


How do I do this?



Many thanks





Phil

6 Replies
tresesco
MVP
MVP

Try like:

Load

          Finance_Month & ' ' Finance_Year as MonthYear,

          MonthName(Date#(Finance_Month & Finance_Year, 'MMMMYYYY')) as MonthYear2   

From <>;


Note: MonthYear2 process is a better approach since this would be a proper date field (numeric underlaying values) while other one is just string.


Edit: correctd

Anonymous
Not applicable
Author

Hi

This returns a text value but not a date field for some reason.

Any thoughts?

Thanks

Phil

tresesco
MVP
MVP

Using MonthYear(date#(..)?

vvvvvvizard
Partner - Specialist
Partner - Specialist

=Date(Date#( Year(Date)*100+Month(Date),'YYYYMM'),'MMM YYYY') as the_date

Anonymous
Not applicable
Author

It fails as MonthYear isn't a function in my script

tresesco
MVP
MVP

Extremely sorry, use MonthName()