Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Including tenths/hundredths of second in Time

Looked at all references to Time and Time# and could only find 'hh:mm:ss tt' documented.  Excel provides for tenths, hundredths, etc. of a second (e.g. "mm:ss.0").  When I do the same with Qlik only those values having zero tenths get converted (as if the zero were a filter!?).

Any suggestions (or workarounds) on how to accomplish displaying tenths/hundredths of a second.  This time precision is important in my application and life would be easier to keep the field as time rather than (say) convert the field to # of tenths of a second and figure out how to reconstruct a display field.

My application compares event times and yes tenths (and in some cases hundredths) of a second are important.

Help Time gurus!  (Thanks in advance.)

Tags (1)
1 Solution

Accepted Solutions

Re: Including tenths/hundredths of second in Time

Not sure if this would help, but may be this:

Time(TimeField, 'hh:mm:ss ttt') // with one extra t

Time(TimeField, 'hh:mm:ss.ffff')

May be you have already tried it and did not work, but I thought it might help to add that there

8 Replies

Re: Including tenths/hundredths of second in Time

Not sure if this would help, but may be this:

Time(TimeField, 'hh:mm:ss ttt') // with one extra t

Time(TimeField, 'hh:mm:ss.ffff')

May be you have already tried it and did not work, but I thought it might help to add that there

MVP
MVP

Re: Including tenths/hundredths of second in Time

As Sunny said, using the correct format code should enable interpreting a timstamp including up to milliseconds.

How do your input records look like? Could you post some samples of that timestamp?

Re: Including tenths/hundredths of second in Time

Hi,

I don't find any issues with the default interpretation of time values including tenth, hundreds or thousandth of a second:

QlikCommunity_Thread_191833_Pic1.JPG

SET TimeFormat='hh:mm:ss';

tabTimes:

LOAD *,

    Text(yourtime) as yourtimetxt,

    Time#(yourtime, 'hh:mm:ss') as yourtime2,

    Time#(yourtime, 'hh:mm:ss.fff') as yourtime3,

    Time#(yourtime, 'hh:mm:ss[.fff]') as yourtime4

Inline [

yourtime

12:34:56

12:34:56.0

12:34:56.1

12:34:56.2

12:34:56.11

12:34:56.12

12:34:56.111

12:34:56.112

];

Like Stefan already asked for, please share a sample of your data to test with.

thanks

regards

Marco

Re: Including tenths/hundredths of second in Time

loading from excel you might have to use a format like

Time(yourtime, 'hh:mm:ss.fff')

QlikCommunity_Thread_191833_Pic2.JPG

SET TimeFormat='hh:mm:ss';

tabTimes:

LOAD A as yourtime,

    Text(A) as yourtimetxt,

    Time(A, 'hh:mm:ss') as yourtime2,

    Time(A, 'hh:mm:ss.fff') as yourtime3,

    Time(A, 'hh:mm:ss[.fff]') as yourtime4

FROM [..\Daten\QlikView\QlikCommunity\QlikCommunity_Thread_191833.xlsx] (ooxml, no labels, table is Tabelle1);

hope this helps

regards

Marco

MVP & Luminary
MVP & Luminary

Re: Including tenths/hundredths of second in Time

'f' is the format code for fractions of a second. 'fff' would be thousands.

I do see it in the Help under "Format Codes"

  • To describe the fractions of a second, use the symbol "f" for each digit.


-Rob

MVP
MVP

Re: Including tenths/hundredths of second in Time

Yes, need to get my eyes checked. I swear that 't' and 'f' looked identical on the small screen yesterday.

Re: Including tenths/hundredths of second in Time

I did not realize that I was typing ttt instead of fff

Not applicable

Re: Including tenths/hundredths of second in Time

Thanks to the community, marked as correct the first response of many!

Never in my wildest dreams did I think the community would tell me to '.f'' it -- and that I'd thank them for it ;^)   (hopefully the humor isn't too off-color for the forum; apologies in advance if it is)