Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Changing hour/date format

Hello, I have this Time/Date cell:

Hour.png

I want to separate the date and the hour from the cell,

how can I do that using the script?

Thank you very much

1 Solution

Accepted Solutions
Not applicable
Author

Hi Juan,

you can do that using 3 functions: Date, Time, Floor

Date(floor(DateTimeField)) as [DateTimeField - Date],

Time(DateTimeField-floor(DateTimeField)) as [DateTimeField - Hour],

See the attached sample qvw.

Ingo.

View solution in original post

3 Replies
Not applicable
Author

Hi Juan,

you can do that using 3 functions: Date, Time, Floor

Date(floor(DateTimeField)) as [DateTimeField - Date],

Time(DateTimeField-floor(DateTimeField)) as [DateTimeField - Hour],

See the attached sample qvw.

Ingo.

Sokkorn
Master
Master

Hi Juan,

Try this simple

LOAD

DATE(DateField)    AS [Dates],

TIME(DateField)    AS [Times],

.....

FROM ....

Regards,

Sokkorn Cheav

jagan
Luminary Alumni
Luminary Alumni

Hi,

You can get the Date and Time in separate fields in in Load Script as suggested by Sokkorn by using DATE() and TIME() methods instead of Calculated dimension.  Calculated Dimensions leads to performance issues.

Hope this helps you.

Regards,

Jagan.