Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Welcome to Qlik Community! Check out our new navigation! FIND OUT MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
mahitham
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
tresesco
MVP
MVP

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

Ivan_Bozov
Luminary
Luminary

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

 

vizmind.eu

View solution in original post

2 Replies
tresesco
MVP
MVP

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

 

 

 

 

Ivan_Bozov
Luminary
Luminary

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

 

vizmind.eu