Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
philmywallet
Contributor

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
MVP
MVP

Re: Concatenate Month & Year to Single Date Field

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

philmywallet
Contributor

Re: Concatenate Month & Year to Single Date Field

Hi

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

Any thoughts?

Thanks

Phil

MVP
MVP

Re: Concatenate Month & Year to Single Date Field

Using MonthYear(date#(..)?

vvvvvvizard
Contributor III

Re: Concatenate Month & Year to Single Date Field

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

philmywallet
Contributor

Re: Concatenate Month & Year to Single Date Field

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

MVP
MVP

Re: Concatenate Month & Year to Single Date Field

Extremely sorry, use MonthName()