Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
MK_8
Contributor II
Contributor II

Concatenate Date and Time field

Hi All, 

I wanted to Concatenate Date and Time field in Qlik Load editor  as DD/MM/YYYY HH:MM:SS (22/12/2022 11:39:00)

I used " Date" &' '&"Time" as "Date_Time"  which is resulting in integer 

 

Can someone please help me. Thanks in advance 

Labels (3)
1 Solution

Accepted Solutions
Or
MVP
MVP

Dates and times are numeric. You can concatenate them into a string, but this is typically not the best practice. You can control the formatting of the individual components using Date(Date,'DD/MM/YYYY') and time(Time,'hh:mm:ss'), but it may be a better idea to add the component fields and format the result, i.e. Timestamp(Date+Time,'DD/MM/YYYY hh:mm:ss').

Do note that for large data volumes, it is usually better to keep the date and time fields separate and, if necessary, add them on the front end. This helps keep the app size down.

View solution in original post

3 Replies
Or
MVP
MVP

Dates and times are numeric. You can concatenate them into a string, but this is typically not the best practice. You can control the formatting of the individual components using Date(Date,'DD/MM/YYYY') and time(Time,'hh:mm:ss'), but it may be a better idea to add the component fields and format the result, i.e. Timestamp(Date+Time,'DD/MM/YYYY hh:mm:ss').

Do note that for large data volumes, it is usually better to keep the date and time fields separate and, if necessary, add them on the front end. This helps keep the app size down.

Taoufiq_Zarra

agree with @Or 

if you must use concat you can use this in load script:

load *,TimeStamp#(Date&' '&Time,'DD/MM/YYYY hh:mm:ss') as NewTime inline [
Date,Time
22/12/2022,11:39:00
];

 

in interface if I use for example hour(NewTime) I get :

Taoufiq_Zarra_0-1672316449659.png

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
MK_8
Contributor II
Contributor II
Author

Thank you, I am trying to calculate the gap between employee Login and Logoff time so I felt adding both fields would help