Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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

Re: How to change date format?

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

];

Re: How to change date format?

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

MVP
MVP

Re: How to change date format?

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

......

Community Browser