Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

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: 
santho_ak
Partner
Partner

Extract Date from Time & Calculate the time difference

Hi,

    I need to extract date. How to extract and calculate the time difference to display in a KPI

4 Replies
vvira1316
Specialist II
Specialist II

Hi,

Are you looking for following

LOAD [Start Date] as StartDate,
StopDate,
(
Floor(StopDate) - Floor([Start Date])) + (
(
Ceil(StopDate, 0.00001) - Floor(StopDate)) -
(
Ceil([Start Date], 0.00001) - Floor([Start Date]))) as TimeDelta
FROM
[..\Data\Time1.xlsx]
(
ooxml, embedded labels, table is Sheet1);

timediff.PNG

Expression

interval(TimeDelta, 'hh:mm')

Sokkorn
Master
Master

Hi Santhoh,

You may try this

If you prefer in load script:

Interval([StopDate]-[Start Date],'hh:mm:ss') AS [Time Difference]


If you prefer in expression:

Interval([StopDate]-[Start Date],'hh:mm:ss')

Sokkorn

santho_ak
Partner
Partner
Author

Thank you. I appreciate you for the time & solution.

santho_ak
Partner
Partner
Author

Thank you for the solution. It works fine.