Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How can I create a calculated field in Qlik Sense that provides a "Duration (in hours)" field? The fields with data are four: START DATE, START TIME, END DATE, and END TIME.
Try it with: interval((START DATE + START TIME) - (END DATE + END TIME), 'hh')
Hi. Marcus.
i concatenate the date and time
How can I calculate the duration between the end of the failure and the start of the failure?
As there is a possibility that duration might be more than 1 hour,
And if what you shared in Screenshot is your time format then try this:-
(Num(Timestamp#("Start Time",'DD-MM-YYYY hh:mm'))-Num(Timestamp#("End Time",'DD-MM-YYYY hh:mm')))*24
Now with this Decimal Digits Might be a little Higher But you can adjust those using num or in measure only.
It will work if the values are really dates and times respectively numeric values and not strings. Your values are left-aligned which is often a sign that they are strings. With functions like:
date#(YourField, FormatPattern)
time#(YourField, FormatPattern)
could you convert the values into numbers. Ideally you don't do it for the duration else within the first step in which these fields are loaded because you will always need numeric values to be able to calculate with them.