Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
cluscombe
Contributor III
Contributor III

Getting Date From Month and Year

I have a table with Month field, Year field, and Employee Count field

MonthYearEmployee Count
Jan201410
Feb201412
Mar201413
Apr201425

I want to use Month and Year to determine a date so that I hook into my Master Calendar.  How do I manipulate Month and Year to end up with a new column in date format that looks like this:

MonthYearDateEmployee Count
Jan20141/1/201410
Feb20142/1/201412
Mar20143/1/201413
Apr20144/1/201425

Thanks!

1 Solution

Accepted Solutions
sunny_talwar

Try this:

LOAD Month,

          Year,

          [Employee Count],

          MakeDate(Year, Num(Month(Date#(Month, 'MMM'))), 1) as Date

          MakeDate(Year, Month, 1) as Date

FROM Source;

Sample Script:

Table:

LOAD Month,

     Year,

     [Employee Count],

     Date(MakeDate(Year, Num(Month(Date#(Month, 'MMM'))), 1)) as Date

FROM

[https://community.qlik.com/thread/206323]

(html, codepage is 1252, embedded labels, table is @1);


Capture.PNG

View solution in original post

3 Replies
sunny_talwar

Try this:

LOAD Month,

          Year,

          [Employee Count],

          MakeDate(Year, Num(Month(Date#(Month, 'MMM'))), 1) as Date

          MakeDate(Year, Month, 1) as Date

FROM Source;

Sample Script:

Table:

LOAD Month,

     Year,

     [Employee Count],

     Date(MakeDate(Year, Num(Month(Date#(Month, 'MMM'))), 1)) as Date

FROM

[https://community.qlik.com/thread/206323]

(html, codepage is 1252, embedded labels, table is @1);


Capture.PNG

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Use MakeDate function in script.

Load Year,

        Month,

        Makedate(Year,Month) as Date,

        EmpCount

From Xyz;

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
cluscombe
Contributor III
Contributor III
Author

Thanks!! That did it!