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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to create a month field from existing date

How do I set a month value from an existing date value? My data has dates listed as "09 June 2011 11:38:29 EST" All I want is to create a field that would only have the month- "June"

4 Replies
swuehl
MVP
MVP

Maybe like

LOAD

     TimestampField,

     Text(Date(TimestampField,'MMMM')) as MonthName,

     ...

You need to ensure that your Timestamp is correctly read in with a numeric representation, please have a look at

Get the Dates Right

HirisH_V7
Master
Master

Hi,

May be use this,

SubField(TimeStamp,' ',2)  as Month

if you require complete calendar table means, go with stefans suggestion.

-Hirish

HirisH
Not applicable
Author

This worked,but how would I add the year to it? like June 2017

swuehl
MVP
MVP

Maybe

Date(Monthstart(TimestampField),'MMMM YYYY') as MonthYear,