Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
abhaysingh
Specialist II
Specialist II

Exp Help

HI All,

I have two Time Value

Time1                               Time 2                              Difference = Time1 - Time2

10:43:36 AM                    10:22:00 AM                         Ouput Required in Seconds

I am simply Doing Time1-Time2 and Getting output 175.98499988425;

expected output is 21:36 Minutes... Final result want in seconds

Please Suggest

Abhay

1 Solution

Accepted Solutions
jonathandienst
Partner
Partner

Time in minutes:

(Frac(Time1) - Frac(Time2)) * 1440

Time in seconds:

(Frac(Time1) - Frac(Time2)) * 1440 * 60

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

12 Replies
sunny_talwar

Try this:

Interval(Time#('10:43:36 AM', 'hh:mm:ss TT') - Time#('10:22:00 AM', 'hh:mm:ss TT'), 'mm:ss')

sasiparupudi1
Master III
Master III

=Interval(Time#('10:43:36 AM', 'hh:mm:ss TT') - Time#('10:22:00 AM', 'hh:mm:ss TT'), 's')

qlikmsg4u
Specialist
Specialist

=Interval(Time#('10:43:36 AM','hh:mm:ss tt')-Time#('10:22:00 AM','hh:mm:ss tt'),'mm:ss')

or

=Interval(Time#('10:43:36 AM','hh:mm:ss tt')-Time#('10:22:00 AM','hh:mm:ss tt'),'ss')&' Seconds'

abhaysingh
Specialist II
Specialist II
Author

HI,

Not Working


Interval(Time#(Time1Field, 'hh:mm:ss TT') - Time#(Time2Field, 'hh:mm:ss TT'), 's')


regards

Abhay



rgvavihs
Specialist
Specialist

Hi try this,

Interval(Time#(Time1)-Time#(Time2),'hh:mm:ss') as TimeDiff

sunny_talwar

See if this is what you want:

Capture.PNG

Expression: =Interval(Time#('10:43:36 AM', 'hh:mm:ss TT') - Time#('10:22:00 AM', 'hh:mm:ss TT'), 'mm:ss')

Digvijay_Singh

Not sure though but It seems your time fields are of Timestamp type else suggested solution would have worked. May be Try Frac() before Time# function.

Not applicable

Hi Abhay,

Go to Number tab,

Choose the format of Time1, Time2, and Difference (TIme1-Time-2) as Time in Number tab.

Regards,

Pavan.

abhaysingh
Specialist II
Specialist II
Author

I m trying below

Interval((Time(DateRecorded_Test, 'hh:mm:ss TT')) - (Time(UTC_World_TIme, 'hh:mm:ss TT')), 'mm:ss')

Regards

Abhay