Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to convert date formate:m/d/yyy to dd-mmm-yyyy

how to convert date formate:m/d/yyy to dd-mmm-yyyy

example 12/1/2012 to Dec-2012

12-1-2012 to Dec-2012

6 Replies
Not applicable
Author

hi

try to Modify SET DateFormat='DD/MM/YYYY'; in the first page

satheshreddy
Creator III

HI,

use the below exp

date(Date,'MMM-YYYY')

function

Agis-Kalogiannis
Employee

Although you are saying dd-mmm-yyyy you are actually giving MMM-YYYY format as an example.

For 12/1/2012

DD-MMM-YYYY will show 12-Dec-2012

MMM-YYYY will show DEC-2012

Which one is that you want?

oknotsen
Master III

If you are referring to column A in your XLS sheet:

Date (and time) in both XLS and QlikView are stored as a number (and as long as you do not go before March 1 1900 even as the same number). How a number is formatted (in other words "shown") to you is all up to your own preferences.

Simply load your data from XLS. Use the date() function to change it into anything you like. So if you want "dd-mmm-yyyy", simply use "date(theDateField, 'dd-mmm-yyyy')".

So, conclusion, you are effectively not converting a date, you are just showing it in the format you like.

May you live in interesting times!
kaushi2020
Creator III

there are 2 ways with which you can do it. 

1. Set this in load editor SET DateFormat='DD/MM/YYYY'

--This will set date format to all dates in this format. 

2. Set as expression only for a single field/object via expression editor - Date(<DateField>, 'DD-MMM-YYYY')

--Only the specific object will be impacted

Aasir
Creator III

Date(Date#('12/1/2012', 'M/D/YYYY'), 'DD-MMM-YYYY')