Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Hour calculation along with timestamp

I have data looks like

OrderToDateFromDate
10012009062516000020090625143000
10022009062624000020090625163000
10032009062514300020090625133000
10042009062516300020090625160000
10052009062513300020090625113000


Todate-From date -I would like to have the result will be in the hour

interval(ToDate-FromDate)*24 as Hours is working .When I have Date along with time is not calculating

I tried Interval#,Floor ,Hour,timestamp# - nothing worked.

timestamp(ToDate-FromDate) as NoofHours

timestamp#

(FromDate& ftime,'DD/MM/YYYY hh:mm:ss') as FDATETIME1,

timestamp#



(ToDate& totime,'DD/MM/YYYY hh:mm:ss') as TODATETIME1,



Thank you in advance for your help.

2 Replies
Not applicable
Author

I gave this a try, but it seems you can't do any operations between variables created with timestamp# (I tried substracting, using age(), etc) ..hopefully somebody has a better idea.

Not applicable
Author

Assuming the table data represents your timestamp format. Then the expression should be:

(timestamp#(ToDate,'YYYYMMDDhhmmss')-timestamp#(FromDate,'YYYYMMDDhhmmss'))*24