Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

change the format of a date

Hi, i have a date field in the format of    DD/MM/YYYY

I am trying to seperate it in the script for day, month, year which i have done by :

Day(Date_Field) as Day,

Month(Date_Field) as Month,

Year(Date_Field) as Year,

But i also want a field for Month-Year but i only want the last 2 digits of the year displayed

so i want..

Jan - 12

Feb - 12

ect.

Can anyone help me?

3 Replies
MVP
MVP

Re: change the format of a date

Hi

This should do the trick

Date(Date_Field, 'MMM - YY')

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable

Re: change the format of a date

Hi Jonathan,

So this is what i put in the script?

Date(INVOICE_DATE, 'MMM - YY')AS MonthYear,

I now get multiple entries for each one?

MVP
MVP

Re: change the format of a date

Hi

That's probably because there is a time component in the field. Date() simply formats, but the underlying values differ, leading to what seems like duplicates. Use this instead:

Date(Floor(INVOICE_DATE), 'MMM - YY')AS MonthYear,

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein