Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
dhavalvyas
Contributor III
Contributor III

Qliksense date format

Hello all,

Hope all r doing well.

I have date as Apr 1 2021 03:34 AM in my field.

I want it in standard date format DD/MMM/YYYY that is 01/Apr/2021

How to achieve this.

Thanks in advance.

 

 

 

Labels (1)
9 Replies
Chanty4u
MVP
MVP

Hi try this

 

load * ,

Date(Date#('Apr 1 2021 03:34 AM','MMM D YYYY hh:mm TT'),'DD/MMM/YYYY') as NewDate;
LOAD * INLINE [
Date
Apr 1 2021 03:34 AM
];


exit SCRIPT;

Chanty4u_1-1648655831040.png

 

 

dhavalvyas
Contributor III
Contributor III
Author

And if in case date is Apr 12 2021 03:34 AM 

Then What should do ?

 

 

Kashyap_R
Partner - Specialist
Partner - Specialist

Hi @dhavalvyas 

The Solution @Chanty4u suggested will work.

Did u try it before replying ? please test it from your side then post the question or reply  and be considerate.

hope this clears  your doubt and if it is resolved please make sure to give the replier like and mark it as solved.

 

Thanks and Regards

Kashyap.R

Thanks and Regards
Kashyap.R
dhavalvyas
Contributor III
Contributor III
Author

Hi Kashyap,

Thanks for your suggestion.i tried it, however

it is not working as per my requirement.

 

Kashyap_R
Partner - Specialist
Partner - Specialist

HI

please attach a sample file with ur date inputs 

Regards 

Kashyap.R

Thanks and Regards
Kashyap.R
dhavalvyas
Contributor III
Contributor III
Author

Please find attached file.

Chanty4u
MVP
MVP

just add other D 

load * ,

Date(Date#('Apr 1 2021 03:34 AM','MMM DD YYYY hh:mm TT'),'DD/MMM/YYYY') as NewDate;
LOAD * INLINE [
Date
Apr 12 2021 03:34 AM
];

dhavalvyas
Contributor III
Contributor III
Author

Still not working.

 

Kashyap_R
Partner - Specialist
Partner - Specialist

Hi @dhavalvyas 

The problem is with the datetime field you are getting it is having 24 hour format and it also has AM/PM

please use either one of the below expression hope it will solve the issue.

Date(Timestamp#(Replace(Replace(Date,'AM',''),'PM',''),'MMM DD YYYY hh:mm'),'DD/MMM/YYYY')

or

Date(Date#(
Replace(Replace(
Timestamp#(Date,'MMM DD YYYY hh:mm TT'),'AM',''),'PM',''),'MMM DD YYYY hh:mm'),'DD/MMM/YYYY')

have a nice day

Thanks and Regards

Kashyap.R

Thanks and Regards
Kashyap.R