Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Adding text in between Time

Hi all,

I have two dates, namely start_date and end_date

and i have  found a duration between them as

     start_date                                       end_date                              Duration

31-aug-2016   08:16:11 Am             31-aug-2016   08:17:11 Am          00:01:00

Here in that duration i want to display it has 00 hrs : 01 min : 00 sec

i want to add text as hrs : min : sec in that duration. pls help me know how to do that.

Thanks

1 Solution

Accepted Solutions
Gysbert_Wassenaar

subfield( interval( end_date - start_date, 'hh:mm:ss'), ':', 1) & ' hrs : ' &

subfield( interval( end_date - start_date, 'hh:mm:ss'), ':', 2) & ' min : ' &

subfield( interval( end_date - start_date, 'hh:mm:ss'), ':', 3) & ' sec'


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Gysbert_Wassenaar

subfield( interval( end_date - start_date, 'hh:mm:ss'), ':', 1) & ' hrs : ' &

subfield( interval( end_date - start_date, 'hh:mm:ss'), ':', 2) & ' min : ' &

subfield( interval( end_date - start_date, 'hh:mm:ss'), ':', 3) & ' sec'


talk is cheap, supply exceeds demand
miguelbraga
Partner - Specialist III
Partner - Specialist III

You can make something like this:

date(floor(start_date), 'DD-MMM-YYYY') & '  ' & hour(time(start_date)) & 'hrs : ' & minutes(time(start_date)) & 'min : ' & seconds(time(start_date)) & ' sec' as start_date,

date(floor(end_date), 'DD-MMM-YYYY') & '  ' & hour(time(end_date)) & 'hrs : ' & minutes(time(end_date)) & 'min : ' & seconds(time(end_date)) & ' sec' as end_date

Best regards,

Data Architect MB

Anonymous
Not applicable
Author

Thanks all for your solutions