Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
how to get sum of 2 time field that have more than 24 hours
I want to get sum 2 time in expression in qlikview like this: 20:25:50 and 22:45:15
And in result show this:43:11:05
If the fields are proper timestamps, simple addition like:
Load
Timestamp(Field1+Field2) as NewField
should work;
No, its not timestamp. its just a time in this format: hh:mm:ss like 20:25:50
Try like:
Load
Timestamp(Timestamp#(Field1, 'hh:mm:ss')+Timestamp#(Field2, 'hh:mm:ss')) as NewField
Try
=Interval(Time('20:25:50') + Time('22:45:15'))
or
=Interval(Time(Field1) + Time(Field2))
or
Interval(Time(Field1) + Time(Field2)) as NewField
Hi,
Try like this
Try like:
Load
*,
Interval(Timestamp#(Field1, 'hh:mm:ss')+Timestamp#(Field2, 'hh:mm:ss'), 'hh:mm:ss')
FROM DataSource;
Hope this helps you.
Regards,
Jagan.
I had a similar issue...my formula looked something like this...used it in a text box, then switched it over to a list box Expression beside the User.
=time( sum( DISTINCT [Session Duration]),'hh:mm:ss')
Also - have you tried sub(Time_Field) and grab each component of the time. Multiply time the appropriate value minutes > to seconds = result * 60 (e.g.) then add the components together?
My quantity of times varied and the above formula worked for me if I had one time or 20 times.
Another thought - have you considered aggr'ing based on specific field (that makes sense for you (e.g. year, month, etc.)?
Hope this helps.
if it's real time/interval values (numerical 0-1) then
Interval(Timefield1+Timefield2)
should do. Otherwise if it's two timestamps you have to first extract the fractional part from the timefields like
Interval(Frac(Timestampfield1)+Frac(Timestampfield2))
hope this helps
regards
Marco
Just tried this it works in a Text box, but not in the script. Any ideas why?
see below.
Interval(Timestamp#(F16,'hh:mm:ss')+Timestamp#(F17, 'hh:mm:ss'), 'hh:mm:ss') as $(vUIAvgACDTime),
jagangmohan Nevermind. I just had to simplify it to:
Interval(F16 + F17, 'hh:mm:ss')