Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 |
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
];
If you are doing it in the script then:
Today() - [openeddate] as 'Age'
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;
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;
No Anil its not working
Hi there are lot of time and date function in Qlik you can go through the help.
one example: Interval(Now()-Date,'hh:mm').
Daniel
Which format you want it as third column ??
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:15 | 13 - 3:32:54 |
6/29/2017 10:27 | 13 - 3:20:54 |
6/29/2017 10:28 | 13 - 3:19:54 |
7/5/2017 11:16 | 7 - 2:31:54 |
7/5/2017 19:10 | 6 - 18:37:54 |
7/5/2017 21:12 | 6 - 16:35:54 |
Cheers
Andrew
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
];
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
];