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 change date format?

Hi all ,

I am having two date formats in single column:

Invoicedate

01-Apr-2014

01-May-2014

01-Jun-2014

42006

42007

42008

42010

How to change change this format to single format i.e, MMM-YYYY(ex: Apr-2015)


thank you

3 Replies
settu_periasamy
Master III
Master III

May be like this..

Load Date(Alt( date#( Invoicedate , 'DD-MMM-YYYY' ),

  Date(Invoicedate),

  'No valid date' ),'MMM-YYYY') as Date;

LOAD * Inline [

Invoicedate

01-Apr-2014

01-May-2014

01-Jun-2014

42006

42007

42008

42010

];

sunny_talwar

Or this should also work


SET DateFormat='DD-MMM-YYYY';

Load DateMonthName(Invoicedate, 'MMM-YYYY') as MonthYear;

LOAD * Inline [

Invoicedate

01-Apr-2014

01-May-2014

01-Jun-2014

42006

42007

42008

42010

];


Capture.PNG

maxgro
MVP
MVP

with the alt function

1.png

load

     Date(alt(Date#(Invoicedate, 'DD-MMM-YYYY'), Invoicedate), 'MMM-YYYY') as Invoicedate

inline [

Invoicedate

01-Apr-2014

01-May-2014

01-Jun-2014

42006

42007

42008

42010

];

or, if you want the same result as Sunny

1.png

load Date(MonthStart(alt(Date#(Invoicedate, 'DD-MMM-YYYY'), Invoicedate)), 'MMM-YYYY') as Invoicedate

......