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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Time arythmetic

Hello,

Im currently trying to add/substract time format.

The fields are like '06:00:00 AM' , '14:00:00 PM', etc.

When i do just like time1 - time2 it returns decimals.

I was wondering if anyone knows a way to transform those decimals to a similar time format?

thanks,

1 Solution

Accepted Solutions
jagan
Partner - Champion III
Partner - Champion III

Hi,

Try like this

=Interval(Timestamp(Timestamp#('06:00:00 AM', 'hh:mm:ss TT')) - Timestamp(Timestamp#('14:00:00 PM', 'hh:mm:ss TT')), 'hh')

Returns -8 in hours.

Hope this helps you.

Regards,

Jagan.

View solution in original post

4 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Times are fractions of a day, so decimals would be a logical result. You probably only need to format the result as a time. Interval(Time1 - Time2, 'hh:mm:ss').


talk is cheap, supply exceeds demand
jagan
Partner - Champion III
Partner - Champion III

Hi,

Try like this

=Interval(Timestamp(Timestamp#('06:00:00 AM', 'hh:mm:ss TT')) - Timestamp(Timestamp#('14:00:00 PM', 'hh:mm:ss TT')), 'hh')

Returns -8 in hours.

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

thank you )))

jagan
Partner - Champion III
Partner - Champion III

Hi,

Please close the discussion by giving correct and helpful answers to the posts which are useful to you..  It helps others to find answers to similar type of scenarios.

Regards,

Jagan.