Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to Create Date Field from Month and Year

Hi All,

How do i create a Date Field if i have Data for Month and Year on an Applymap Function?

e.g June 2015

Thanks.

6 Replies
sunny_talwar

You can use MakeDate() function

MakeDate(Year, Month, Day) as Date and if you don't have day you can use any day

MakeDate(Year, Month, 1) as Date

Not applicable
Author

Hi Sunny,

i dont want to include the Day as it will confuse my model that has Days.

do i have to take out only day?

Thanks.

sunny_talwar

You need to put that there to create a date, but after that you can format it anyway you want. For instance:

Date(MakeDate(Year, Month, 1), 'MMM-YYYY') as Date or my personal favorite

MonthName(MakeDate(Year, Month, 1)) as MonthYear

manojkulkarni
Partner - Specialist II
Partner - Specialist II

Without Day, you cann't make any date field. 

sunny_talwar

You can try this also:

Date#(Year & '-' & Month, 'YYYY-MMM') as Date

DeeC84
Contributor
Contributor

Hi there, 

I have 3 data tables and want a variable at the top of my worksheet that allows the user to select Month and have the 3 below tables perform their formulations as per the month selected in the variable input. 

Could you please help me create a variable where the end user can select a month and have the below datasets reflect corresponding data to the selected month?

Currently my variable is named 'vAsOfPricingMonthValue'  and the expression is 'Month' .

Thank you in advance!