Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
sashokku
Contributor II

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

Re: Extract Date from Time & Calculate the time difference

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

Re: Extract Date from Time & Calculate the time difference

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

sashokku
Contributor II

Re: Extract Date from Time & Calculate the time difference

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

sashokku
Contributor II

Re: Extract Date from Time & Calculate the time difference

Thank you for the solution. It works fine.

Community Browser