# QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

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
MVP

## 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
MVP

## 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

## 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?

MVP

## 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:

```SET TimeFormat='hh:mm:ss';

tabTimes:
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
];
```

thanks

regards

Marco

MVP

## Re: Including tenths/hundredths of second in Time

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

```SET TimeFormat='hh:mm:ss';

tabTimes:
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

## 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

## 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.

MVP

## 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)

Community Browser