Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Announcing the newest addition to the Qlik Community, Qlik Gallery! Learn More
Highlighted
abhaysingh
Valued Contributor 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
MVP
MVP

Re: Exp Help

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
12 Replies

Re: Exp Help

Try this:

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

sasiparupudi1
Honored Contributor III

Re: Exp Help

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

qlikmsg4u
Valued Contributor

Re: Exp Help

=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
Valued Contributor II

Re: Exp Help

HI,

Not Working


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


regards

Abhay



rgvavihs
Valued Contributor

Re: Exp Help

Hi try this,

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

Re: Exp Help

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
Honored Contributor III

Re: Exp Help

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

Re: Exp Help

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
Valued Contributor II

Re: Exp Help

I m trying below

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

Regards

Abhay