Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

espoc date converstion to Qlik format

Hi I am currently loading Oracle data into Qlikview, I have a date field creation_date as

11052931376000
21052931469000
31052989210000
41052989493000
51052989855000
61052990059000

Now I want to convert this into human date field into YYYYMMDD format.

I am currently using "Timestamp(MakeDate(1970) + creation_date/60/60/24) as creation_date" but output is something like this

17/02/35303 17:13:20

I want it to be YYYYMMDD format, Please advise

Thanks for your help

1 Solution

Accepted Solutions
Anil_Babu_Samineni

Why not?

Date((25569 + Round(FieldName/1000) / 86400), 'YYYYMMDD') as FieldName


Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

16 Replies
Anil_Babu_Samineni

Perhaps this?

Date(Date#(MakeDate(1970) + creation_date/60/60/24),'DD/MM/YYYYY hh:mm:ss'),'YYYYMMDD') as creation_date

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

There seems to be an error in the formula? One bracket is extra closed?

sunny_talwar

What date do you expect this to be?

1052931376000

Anonymous
Not applicable
Author

Actually I don't know the output as I don't have direct access to the source,but for this 28799843280210  if I use

Timestamp(MakeDate(1970) + creation_date/60/60/24) as creation_date I am getting output as 17/02/35303 17:13:20

but I would except to be something like Year0217, Year may be 2016 or 2107

Anil_Babu_Samineni

This returns as

=Date((25569 + Round(1052931376000/1000) / 86400), 'YYYYMMDD')

Capture.PNG

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

I want to achieve this in script side please

sunny_talwar

How about this?

=Timestamp(MakeDate(1970) + creation_date/60/60/24/1000)

Anil_Babu_Samineni

Why not?

Date((25569 + Round(FieldName/1000) / 86400), 'YYYYMMDD') as FieldName


Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Thank you, I am getting output as 02/05/2003 16:13:02 but need it to be 20030502  YYYYMMDD