Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
drohm002
Creator II
Creator II

convert text field of numbers to a time

Hello, in the example below, how do i convert ACQUISITIONTIME of 163821.556552 to 16:38:21?

drohm002_0-1770928423679.png

i already tried Time(Time#(ACQUISITIONTIME, 'HHMMSS'), 'HH:MM:SS') as FormattedTime

1 Solution

Accepted Solutions
marcus_sommer
MVP
MVP

A converting worked only if the specified format-pattern is absolutely identically to the values. It means in your case the milliseconds needs to be removed which might be done by numeric values with a rounding and by strings with any string-function. Further the format-pattern is case-sensitive. Therefore try it with:

Time(Time#(subfield(ACQUISITIONTIME, '.', 1), 'hhmmss'), 'hh:mm:ss') 

View solution in original post

3 Replies
Chanty4u
MVP
MVP

Hi 

Try this 

Time(

    Time#(Floor(Num(ACQUISITIONTIME)), 'HHMMSS'),

    'hh:mm:ss'

) as FormattedTime

marcus_sommer
MVP
MVP

A converting worked only if the specified format-pattern is absolutely identically to the values. It means in your case the milliseconds needs to be removed which might be done by numeric values with a rounding and by strings with any string-function. Further the format-pattern is case-sensitive. Therefore try it with:

Time(Time#(subfield(ACQUISITIONTIME, '.', 1), 'hhmmss'), 'hh:mm:ss') 

Nagaraju_KCS
Specialist III
Specialist III

try this 

=Time(Time#((Floor(163821.556552)), 'hhmmss'), 'hh:mm:ss')

Nagaraju_KCS_0-1770970385573.png