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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
johnan
Creator III
Creator III

Date format

Hi,

I have from DB = 20091010

and time 14934

I want to format date to 2009-10-10
And the time to 01:49:34

5 Replies
Not applicable

In one of my cases I did like this:

1. Parsed the day, month and year for date and hour,minute,seconds from time.

2. Used makedate() and maketime() to derive the date and time in the desired format.

Would this help?

--Arun

johnan
Creator III
Creator III
Author

Hi, no i'ts not workingSad

Not applicable

Oops...

But something like this should work...?

date(MakeDate(left(Date,4),mid(Date,5,2),right(Date,2)),'YYYY-MM-DD')

where Date is your input.

--Arun

johnan
Creator III
Creator III
Author

Hmm, todays date give me 40103 nowTongue Tied

Not applicable

If your DB is a string, definitly this should work. See my example, below expression in a text box gives me the correct result:

=date(MakeDate(left('20091009',4),mid('20091009',5,2),right('20091009',2)),'YYYY-MM-DD')

If DB is numeric, can't we use similar numeric functions to parse? May be I'm thinking too basic than what you expect..

--Arun