Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Welcome to Qlik Community! Check out our new navigation! FIND OUT MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
narender123
Specialist
Specialist

Calculate time difference

Hi all ,

I have to calculate the time differnce between two dates . Likes:

Column1                                   Column2

09-09-2014 13:28:46                   41891.576825799

Calculate time formate like hh:mm:ss

Both columns are date column .Column2 is in Num format of date.

Please suggest.

Thanks,

Narender

1 Solution

Accepted Solutions
balrajahlawat
Champion
Champion

may be like this?

Use TimeStamp() at script, like?

TimeStamp#(Coulmn2, 'DD-MM-YYYY hh:mm:ss')  as Column2DateTime

Now to find out the difference between two date column, try like this?

Interval(Column1 - Column2DateTime, 'hh:mm:ss') as Diff

View solution in original post

20 Replies
PrashantSangle

H,

Use interval()

For Example:

Interval(time2-time1,hh:mm)

For details see it in help menu.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try Interval()

Regards,

Jagan.

settu_periasamy
Master III
Master III

Hi,

Try this..

=Interval(41891.576825799-TimeStamp#('09-09-2014 13:28:46','DD-MM-YYYY hh:mm:ss'),'hh:mm:ss')

balrajahlawat
Champion
Champion

may be like this?

Use TimeStamp() at script, like?

TimeStamp#(Coulmn2, 'DD-MM-YYYY hh:mm:ss')  as Column2DateTime

Now to find out the difference between two date column, try like this?

Interval(Column1 - Column2DateTime, 'hh:mm:ss') as Diff

tamilarasu
Champion
Champion

You can also try,

Interval(Column1 - Num(Date#(Column2, 'DD-MM-YYYY hh:mm:ss')),'hh:mm:ss')

vsudhakar
Creator III
Creator III

interval(column2 - column1,'DD-MM-YYYY hh:mm:ss') as differencetime

narender123
Specialist
Specialist
Author

Hi All,

Thanks you all.

I got the difference.

for total i have selected sum of rows in expression tab .So now it is showing total also.

But i want the Avg of all the time difference rather than toatl of "hh:mm:ss" means "sum of interval differnce/total number of entries".

Correct me if i am wrong.

Narender

narender123
Specialist
Specialist
Author

Thank you.

Please see my reply to Jagan Mohan ,i have one more question.

Narender

narender123
Specialist
Specialist
Author

Thank you.

Please see my reply to Jagan Mohan ,i have one more question.

Narender