Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have 2 columns in my table that are both shown like this:
Date 1 - dd/mm/yyyy hh:mm:ss
Date 2 - dd/mm/yyyy hh:mm:ss
I want to show the difference between the two so that I can see how long it has been with a person but everything I try, nothing seems to work. Any ideas please?
Hi, @New-here1
Have you tried Interval ?
Hello,
Maybe you should try that solution :
Interval(Timestamp#([Date2], 'DD/MM/YYYY hh:mm:ss') -Timestamp#([Date1], 'DD/MM/YYYY hh:mm:ss'), 'd hh:mm:ss')
Have a nice day,
Sadly interval didn't work
unfortunately, interval doesnt work. The result just comes back with nothing
in @Eloi reply use trim if in case raw column is string ( you can verify calling fields -list box in sheet or in preview , String values will be aligned left side , where as date and numeric values will align rightside).
Interval(Timestamp#([trim(Date2]), 'DD/MM/YYYY hh:mm:ss') -Timestamp#([trim(Date1]), 'DD/MM/YYYY hh:mm:ss'), 'd hh:mm:ss')
Hi @New-here1
Using Interval(value2-value1), as suggested by@BPiotrowski , @Eloi and @PREMinQLIK_DBS2 , will be the best way forward.
You bet blank/null values because Qlik does not recognise the two fields as timestamps.
If you have issues getting the Date fields into timestamp formats then please add additional information on how the timestamps are created in the script. And which steps you have tried to solve your issue.