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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
mccook
Creator
Creator

Converting Julian Date and Time in QlikView

Hi,

If I have a julian date that I need to convert in QlikView i use something like this:

Date(MakeDate(1900+left(text(FIELDNAME),len(FIELDNAME)-3))+right(text(FIELDNAME),3)-1) as [Date],

But I'm not sure how to convert a field that is Date and Time.

Can you help please?

Cheers,


Dean

1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

What does your field look like? Is the time just the decimal part, so that Jan 3, 2014 12:00 is written as 2014003.5 ?

If so, I would suggest

     Floor(FIELDNAME / 1000) as Year,

     1000 * Frac(FIELDNAME / 1000) as DayAndTime,

     TimeStamp( MakeDate( Floor(FIELDNAME / 1000) ) + 1000 * Frac(FIELDNAME / 1000) -1 ) as Timestamp,

HIC

View solution in original post

1 Reply
hic
Former Employee
Former Employee

What does your field look like? Is the time just the decimal part, so that Jan 3, 2014 12:00 is written as 2014003.5 ?

If so, I would suggest

     Floor(FIELDNAME / 1000) as Year,

     1000 * Frac(FIELDNAME / 1000) as DayAndTime,

     TimeStamp( MakeDate( Floor(FIELDNAME / 1000) ) + 1000 * Frac(FIELDNAME / 1000) -1 ) as Timestamp,

HIC