Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi there,
I am quite new to Qlikview and needed some assistance with formatting time. Currently, one of my fields 'MyTime' is showing data as:
7:48:20 AM
14:45:54 PM
Can someone please help me in rounding off the seconds (or just getting rid of the seconds) so that the time appears as:
7:48
14:46
Any help will be much appreciated.
Regards,
Patrick
Hi,
if your MyTime field is already time/dual (underlying numerical value formatted as time) and you like to round off to minutes, then
Time(Floor(MyTime, 1/1440),'hh:mm')
should do.
If your MyTime field is already time/dual (underlying numerical value formatted as time) and you like to keep the numerical value (incl seconds), then
Time(MyTime, 'hh:mm')
should do.
If your MyTime field is text (no underlying numerical value) and you like to round off a newly generated numerical representation to minutes, then
Time(Floor(Time#(MyTime, 'hh:mm:ss TT'),1/1440), 'hh:mm')
should do.
If your MyTime field is text (no underlying numerical value) and you like to keep the seconds in a newly generated numerical representation, then
Time(Time#(MyTime, 'hh:mm:ss TT'), 'hh:mm')
should do.
hope this helps
regards
Marco
Hi
Use Time format HH:mm in the number dialog, or use Time(myField, 'HH:mm') to format in the expression.
HTH
Jonathan
Hi,
if your MyTime field is already time/dual (underlying numerical value formatted as time) and you like to round off to minutes, then
Time(Floor(MyTime, 1/1440),'hh:mm')
should do.
If your MyTime field is already time/dual (underlying numerical value formatted as time) and you like to keep the numerical value (incl seconds), then
Time(MyTime, 'hh:mm')
should do.
If your MyTime field is text (no underlying numerical value) and you like to round off a newly generated numerical representation to minutes, then
Time(Floor(Time#(MyTime, 'hh:mm:ss TT'),1/1440), 'hh:mm')
should do.
If your MyTime field is text (no underlying numerical value) and you like to keep the seconds in a newly generated numerical representation, then
Time(Time#(MyTime, 'hh:mm:ss TT'), 'hh:mm')
should do.
hope this helps
regards
Marco
Thank you so much.
Kind regards,
Patrick
You're welcome
regards
Marco