Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Suppose I have a [Time]: 164551 seconds. I want it to show with hh:mm:ss format.
I tried two ways, but neither worked.
1. If I put my function as [Time], choose number formatting as Duration and format pattern as h:mm:ss, then it shows as 3949224:00:00, which is the wrong result.
2. If I put my function as time([Time],'hh:mm:ss'), the result also shows as 3949224:00:00.
What's wrong with these two methods? What should I do?
Thanks in advance!
Maybe someone else will come with a more meaningful response. You may want to forgo using the format in the UI, and try formatting it in the dimension.
Try something like this:
Data:
TestData:
LOAD * Inline
[
'UserId', 'seconds'
1, 164551
]
;
EXIT Script
;
UI;
=Interval(seconds/86400,'h:mm:ss')
On another note, I'm not sure why my original attempt at Time(Time#(seconds,'s'),'hh:mm ss') didn't work and gave me the wrong answer.
Hope this helps.
Try this
Time(Time#([Time], 'ss'),'hh:mm:ss')
Maybe someone else will come with a more meaningful response. You may want to forgo using the format in the UI, and try formatting it in the dimension.
Try something like this:
Data:
TestData:
LOAD * Inline
[
'UserId', 'seconds'
1, 164551
]
;
EXIT Script
;
UI;
=Interval(seconds/86400,'h:mm:ss')
On another note, I'm not sure why my original attempt at Time(Time#(seconds,'s'),'hh:mm ss') didn't work and gave me the wrong answer.
Hope this helps.
Thanks for help!
I tried with Time(Time#([Time], 'ss'),'hh:mm:ss') and number formatting: Auto. The result was 21:42:31, which I don't think matches 164551 seconds?
Hello Sunny,
For some reason, this gives the wrong answer, it gives 21 hours and some change. I'm not quite sure why this doesn't work.
Do you mean seeing 21:42:31 instead of 45:42:31? I guess time function only shows time and skips the day... May be this
=Interval(Interval#(164551, 's'), 'hh:mm:ss')
Try this or what Justin gave
=Interval(Interval#(164551, 's'), 'hh:mm:ss')
Thank you very much!
Thank you very much!