Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Chinnu3
Contributor III
Contributor III

Qlik

I have two dates along with time

Closed date (2020-11-16 09:30:45)

Open date (2020-11-14 06:35:40)

(Closed date - Open date) 

I want mean time in (days and hr:mm:ss) format like 2days 2hrs 54mins 56 seconds

In Qlik sense measure in Qlik table. 

2 Replies
abhijitnalekar
Specialist II
Specialist II

Hi @Chinnu3 ,

Please try the below expression.

=Interval([Timestamp("Close Date")]-[timestamp("Open Date")],'DD HH:mm:ss')

and formatting you can get the 

https://community.qlik.com/t5/QlikView-App-Dev/Date-Square-Problem/m-p/1120826/highlight/true#M89540...

 

 

Regards,
Abhijit
keep Qliking...
Help users find answers! Don't forget to mark a solution that worked for you!
Anku
Creator
Creator

Hi @Chinnu3 ,

To get the difference as a statement,

Try below:

1. Create a variable

Name: vDifference

Definition: Date([Closed date] - [Open date],'HH:MM:SS')

 

2. Create table

Dimension: Open date

Dimension: Closed date

Measure: 

Interval(timestamp([Closed date])- timestamp([Open date]),'DD')&' Day '& Hour($(vDifference))&' Hrs '& Minute($(vDifference))&' min '& Second($(vDifference))&' sec'