Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Talk to Experts, a LIVE Q&A Webinar. Bring your Qlik Sense Business questions on Aug. 4th. Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator II
Creator II

How to extract Month from Date

Extract Year from Date

Hi ,

I have date field with below records. Please help me to derive Month and Date(DD/MM/YYYY)field from below date field.

Date

CMM 01 May 2020

CCM 02 Apr 2019

CCM 05 Aug 2020

CCM 10 April 2020

Thanks in advance

2 Solutions

Accepted Solutions
Highlighted
MVP
MVP

Re: How to extract Month from Date

I see that you have asked for help to extract year from these dates in another post. Therefore, posting the entire date extraction here. Try like:

 

Load
      Year(Date) as Year,
      Month(Year) as Month,
      Date;
Load
      MakeDate(Year, Month(Date#(MonthText, 'MMM')), Day) as Date;
Load
      Subfield(Date, ' ',4) as Year,
      Left(Subfield(Date, ' ', 3),3) as MonthText,
      Num(Subfield(Date, ' ', 2)) as Day
From <>;

 

 

 

 

View solution in original post

Highlighted
Luminary
Luminary

Re: How to extract Month from Date

This is for day, month, year,  and full date:

SUBFIELD(Date,' ',2) AS Day,
LEFT(SUBFIELD(Date,' ',3),3) AS Month,
RIGHT(Date,4) AS Year,
DATE(DATE#(SUBFIELD(Date,' ',2) & LEFT(SUBFIELD(Date,' ',3),3) & RIGHT(Date,4),'DDMMMYYYY'),'DD.MM.YYYY') AS Date

 

View solution in original post

2 Replies
Highlighted
MVP
MVP

Re: How to extract Month from Date

I see that you have asked for help to extract year from these dates in another post. Therefore, posting the entire date extraction here. Try like:

 

Load
      Year(Date) as Year,
      Month(Year) as Month,
      Date;
Load
      MakeDate(Year, Month(Date#(MonthText, 'MMM')), Day) as Date;
Load
      Subfield(Date, ' ',4) as Year,
      Left(Subfield(Date, ' ', 3),3) as MonthText,
      Num(Subfield(Date, ' ', 2)) as Day
From <>;

 

 

 

 

View solution in original post

Highlighted
Luminary
Luminary

Re: How to extract Month from Date

This is for day, month, year,  and full date:

SUBFIELD(Date,' ',2) AS Day,
LEFT(SUBFIELD(Date,' ',3),3) AS Month,
RIGHT(Date,4) AS Year,
DATE(DATE#(SUBFIELD(Date,' ',2) & LEFT(SUBFIELD(Date,' ',3),3) & RIGHT(Date,4),'DDMMMYYYY'),'DD.MM.YYYY') AS Date

 

View solution in original post