Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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.
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.
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 :
Thank you, I am trying to calculate the gap between employee Login and Logoff time so I felt adding both fields would help