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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Convertion of diff date format in to unique format

Hi All,

I have date field in the attached excel. it is in DD-MM-YYYY and in string format. i need to convert everything in to DD-MM-YYYY format.

For Instance in the attached excel i have 01-08-2013, 01-09-2013 and some string dates like 15/01/2013 , 16/01/2013 but all are belongs to january month.

Expected result is 08-01-2013, 09-01-2013, 15-01-2013, 16-01-2013

Kindly help me to resolve this.

Thanks in Advance.

Mahi.

10 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

See here for a solution


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks Gysbert,

But again am facing an issue, am getting dates for strings not for num. for instance in attached excel i have

01-01-2013, 01-02-2013, 01-08-2013, 01-09-2013, 01-10-2013.

But am not getting this values. kindly help me to get this data also in DD-MM-YYYY format.

Thanks in Advance.

Mahi.

Not applicable
Author

Try this

Hope you are looking this

Date(makedate(right(fieldname,4),mid(fieldname,4,1),subfield(fieldname,'/',1)),"DD-MM-YYYY")

Regards,

Amay

Not applicable
Author

Actually In excel, the remaining dates are in dd-mm-yyyy format but i want that in mm-dd-yyyy format.

I Mean all the dates  ( 01-01-2013, 01-02-2013, 01-08-2013, 01-09-2013, 01-10-2013 )belongs to January Month.

Kindly help me to resolve this.

Thanks in Advance.

Mahi

Not applicable
Author

Hi

As per my understanding you required to convert string to Date format then try this

Date(Date#(DateField,'DD/MM/YYYY'),'DD-MM-YYYY')

sorry if i'm wrong in understanding

Best of luck

manideep78
Partner - Specialist
Partner - Specialist

Hi see below code

LOAD Date(Date#(A,'DD/MM/YYYY'),'DD-MM-YYYY') as A,

     B

FROM

C:\Users\Manideep\Downloads\comm_excel.xlsx

(ooxml, no labels, table is Sheet1);

A B
18-01-2013 AAA
22-01-2013 AAA
28-01-2013 AAA
16-01-2013 AAA
31-01-2013 AAA
15-01-2013 AAA
30-01-2013 AAA

AAA

BBB
Not applicable
Author

Hi Manideep and satish, thanks for your reply. This is ok, am getting string format dates as date format. but few dates i have in DD-MM-YYYY  ( 01-01-2013, 01-02-2013, 01-08-2013, 01-09-2013, 01-10-2013 ) format i need to convert that in to MM-DD-YYYY format. i need to convert all the above mentioned dates belongs to JAN month.

Thanks in Advance,

Mahi.

manideep78
Partner - Specialist
Partner - Specialist

try this

LOAD if(Month(Date(Date#(A,'DD/MM/YYYY'),'DD-MM-YYYY'))=1,Date(Date#(A,'DD/MM/YYYY'),'MM-DD-YYYY'),Date(Date#(A,'DD/MM/YYYY'),'DD-MM-YYYY')) as A,

     B

FROM

C:\Users\Manideep\Downloads\comm_excel.xlsx

(ooxml, no labels, table is Sheet1);

Not applicable
Author

Hi Manideep,

Thanks for your effort, again am not getting the data  ( 01-01-2013, 01-02-2013, 01-08-2013, 01-09-2013, 01-10-2013 ) in that date field.

I need to include that data also which are in date month year format ( i need to convert that into month date year)

Thanks in Advance,

Mahi