Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
i may be missing something pretty obvious here,
i want to display time in hours, e.g. 37.5 and a half hours will be 37:30:00 and not 13:30:00.
similar to the custom format in excel where you can put it as [ h ]:mm:ss.
also how can i show negative times. e.g. 07:00:00 - 07:30:00 = -00:30:00
Thanks
Use interval(). Something like interval(sum(YourDurationField),'hh:mm:ss'). Time() is a clock time, so is limited to 24 hours. Interval() is a duration of time, so has no such limit. For that matter, your duration field that you're summing should be an interval as well, not a time() or timestamp().
You can use the Time(Time_Value,'hh:mm:ss'). Be careful because Time_Value must be in Days, so if your field keeps hours, you should divide it by 24.
Look for it in qlik´s help under formating functions for more details.
i have done a sample application and attached with this post. what i have done is i have inline table to enter the time. I used subfield function to separate hrs and minutes. used apply map function to recalculate minute ( cos in ur application 37.5 is 37 hrs :30 minutes. Go through the application you will understand the code.its very simple and easy application
i may have been misleading in the original question,
the table has the time in days e.g. 0.3125 which is easy to display as 07:30:00
the problem comes when summing these. so i want 1.5625 to be displayed as 37:30:00.
in excel you can chose the format as [ h ]:mm:ss how can i do something similar in qlikview.
is this possible without having to add up the hours manually?
i dont think there is any easy way to do it. what i would do is i will separate the value before the decimal and multiply it with 24 . then add it with time we get using time('.'& subfield(timevalue,'.',2)) ......
Use interval(). Something like interval(sum(YourDurationField),'hh:mm:ss'). Time() is a clock time, so is limited to 24 hours. Interval() is a duration of time, so has no such limit. For that matter, your duration field that you're summing should be an interval as well, not a time() or timestamp().
I didn´t know this function! Very Interesting!
brilliant! thanks john!
FERNANDOTOLEDO
Tu solucion fue de utilidad y me ayudo al problema similar que tenia