Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
ravindraa
Creator
Creator

Date format issue

Hi all,

   I have struck one please give me some suggestion to come out from this.

actually i am loading the data from data base the date format is YYYY-MM-DD-HH-MM, but we need YYYY-MM-DD format only, for that i wrote code in edit script level like below

date(Date,'DD/MM/YYYY') as Database_Date,

some date's are in Number format those are not changing , please give suggestion how to change numbers format dates into dates.

please find the attachment .

Thanks in advance.

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Well I guess I have found it. Try loading the date field like:

Date(35065+YourNumber/86400-7/24)


So the entire statement:


If(Len(Date)>5, Date(35065+Date/86400-7/24), Date(Date, 'DD/MM/YYYY')) as Date,

View solution in original post

9 Replies
Chanty4u
MVP
MVP

hi,

SET DateFormat='DD/MM/YYYY'; // You can set whatever format you want-date or timestamp

Chanty4u
MVP
MVP

or

Alt(

    Date(Floor(Date#("field",'YYYY-MM-DD-HH-MM')),'DD/MM/YYYY'),

    Date(Floor(Date("field",'YYYY-MM-DD-HH-MM')),'DD/MM/YYYY')

    ) as "Date",

Chanty4u
MVP
MVP

tresesco
MVP
MVP

Your numbers are nine digit. Perhaps this is not UNIX date. What date format is this? What date do you expect from a number - 148435331?

tresesco
MVP
MVP

Well I guess I have found it. Try loading the date field like:

Date(35065+YourNumber/86400-7/24)


So the entire statement:


If(Len(Date)>5, Date(35065+Date/86400-7/24), Date(Date, 'DD/MM/YYYY')) as Date,

ravindraa
Creator
Creator
Author

Thanks for replying all,

Hi Tresesco,

  I have loaded data form data base then i am checking data , here i am found this format i have tried to change this format but it is not chaining the format.

   i want data format like  following format Tresesco YYYY/MM/DD , please give me suggestion how to change this format.

Thanks in advance................................

tresesco
MVP
MVP

Check my updated reply above.

ravindraa
Creator
Creator
Author

Thank you very much Trsesco,

   it is working for me, could you explain me about this logic -Date(35065+Date/86400-7/24)

Thank you very much Tresesco............................

tresesco
MVP
MVP

Check it here