Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

cluscombe
New 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

Re: Getting Date From Month and Year

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

3 Replies

Re: Getting Date From Month and Year

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

Re: Getting Date From Month and Year

Hi,

Use MakeDate function in script.

Load Year,

        Month,

        Makedate(Year,Month) as Date,

        EmpCount

From Xyz;

Regards,

Kaushik Solanki

cluscombe
New Contributor III

Re: Getting Date From Month and Year

Thanks!! That did it!

Community Browser