Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
soniasweety
Master
Master

Differance in Time

Hi all,

I want to calculate the time difference  ,I have a filed like below

opendate ,and I need a new column I like  (current time- openeddate )  How to calculate?

May be small issue but am new to Qlik

   

OpenDate
7/5/2017 11:16
7/5/2017 21:12
7/5/2017 19:10
7/5/2017 21:12
7/5/2017 21:12
6/29/2017 10:15
6/29/2017 10:27
6/29/2017 10:28
1 Solution

Accepted Solutions
dberkesacn
Partner - Creator III
Partner - Creator III

Ye Andrew,

but everything can be calculated at the backend.

Data:

LOAD

OpenDate,

Interval(Now()-OpenDate,'dd-hh:mm') as Delta;

LOAD

Timestamp#(OpenDate,'M/DD/YYYY hh:mm') as OpenDate

;

LOAD * Inline [

OpenDate

7/5/2017 11:16

7/5/2017 21:12

7/5/2017 19:10

7/5/2017 21:12

7/5/2017 21:12

6/29/2017 10:15

6/29/2017 10:27

6/29/2017 10:28

];

View solution in original post

13 Replies
dan_sullivan
Creator II
Creator II

If you are doing it in the script then:

Today() - [openeddate] as 'Age'

Anil_Babu_Samineni

Are you talking about some thing like below

Load Date(Now(), 'MM/DD/YYYY hh:mm') as CurrentDate,

     OpenDate,

     Date(Now(), 'MM/DD/YYYY hh:mm') - Date(OpenDate,'MM/DD/YYYY hh:mm') as FieldName

From Source;

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
soniasweety
Master
Master
Author

No result used below script

date:
LOAD * Inline [

OpenDate
7/5/2017 11:16
7/5/2017 21:12
7/5/2017 19:10
7/5/2017 21:12
7/5/2017 21:12
6/29/2017 10:15
6/29/2017 10:27
6/29/2017 10:28

]
;

LOAD *
,
Today() - [OpenDate] as 'Age'

Resident date;

soniasweety
Master
Master
Author

No Anil its not working

anil.PNG

dberkesacn
Partner - Creator III
Partner - Creator III

Hi there are lot of time and date function in Qlik you can go through the help.

http://help.qlik.com/en-US/qlikview/12.1/Subsystems/Client/Content/Scripting/DateAndTimeFunctions/da...

one example: Interval(Now()-Date,'hh:mm').

Daniel

Anil_Babu_Samineni

Which format you want it as third column ??

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
effinty2112
Master
Master

Hi sony,

Try:

Data:

load

Timestamp#(OpenDate,'M/DD/YYYY hh:mm') as OpenDate;

LOAD * Inline [

OpenDate

7/5/2017 11:16

7/5/2017 21:12

7/5/2017 19:10

7/5/2017 21:12

7/5/2017 21:12

6/29/2017 10:15

6/29/2017 10:27

6/29/2017 10:28

];

then this straight table gives days,hours, min and sec since reload

OpenDate =Interval(now(0) - OpenDate,'d - h:m:s')
 
6/29/2017 10:1513 - 3:32:54
6/29/2017 10:2713 - 3:20:54
6/29/2017 10:2813 - 3:19:54
7/5/2017 11:167 - 2:31:54
7/5/2017 19:106 - 18:37:54
7/5/2017 21:126 - 16:35:54

Cheers

Andrew

Anil_Babu_Samineni

Use this?

LOAD ClosedDate, OpenDate, NetWorkDays(OpenDate , ClosedDate) as FieldName3;

LOAD Date(Now(), 'MM/DD/YYYY hh:mm') as ClosedDate, Date(Date#(OpenDate,'M/DD/YYYY hh:mm'),'MM/DD/YYYY hh:mm') as OpenDate Inline [

OpenDate

7/5/2017 11:16

7/5/2017 21:12

7/5/2017 19:10

7/5/2017 21:12

7/5/2017 21:12

6/29/2017 10:15

6/29/2017 10:27

6/29/2017 10:28

];

Capture.PNG

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
dberkesacn
Partner - Creator III
Partner - Creator III

Ye Andrew,

but everything can be calculated at the backend.

Data:

LOAD

OpenDate,

Interval(Now()-OpenDate,'dd-hh:mm') as Delta;

LOAD

Timestamp#(OpenDate,'M/DD/YYYY hh:mm') as OpenDate

;

LOAD * Inline [

OpenDate

7/5/2017 11:16

7/5/2017 21:12

7/5/2017 19:10

7/5/2017 21:12

7/5/2017 21:12

6/29/2017 10:15

6/29/2017 10:27

6/29/2017 10:28

];