Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

jamesehunt
New Contributor III

Time format (hhmmss) shown wrong

Hi all,

I have a matrix which looks like this:

Carton IDScan Date Scan Time
17690011051122018051181958

In the  "Data load editor" I added the following

The result for the Date is correct, but unfortunately the time is wrong. It should be 08:19:58 (hh:mm:ss)

Can someone please help.

Much obliged

1 Solution

Accepted Solutions
MVP
MVP

Re: Time format (hhmmss) shown wrong

I think sunilkumarqv‌ might have meant this...

Table:

LOAD *,

Time(Time#(TPROA, If(Len(Trim(TPROA)) = 5, 'hmmss', 'hhmmss'))) as [Time-scan-return-carton];

LOAD * Inline [

TPROA

81920

182130

];

The above seems to work

Capture.PNG

8 Replies
MVP
MVP

Re: Time format (hhmmss) shown wrong

Try this (use single h instead of 2)

Time(Time#(TPROA, 'hmmss')) as [Time-scan-return-carton]

jamesehunt
New Contributor III

Re: Time format (hhmmss) shown wrong

Hi Sunny,

unfortunately scan time can be

81920 = 08:19:20 as well as

182130 = 19:21:30 (which are now not shown correctly)

sunilkumarqv
Valued Contributor II

Re: Time format (hhmmss) shown wrong

please share sample

dsharmaqv
Contributor III

Re: Time format (hhmmss) shown wrong

Try this, it should work

=Time(Timestamp#(81920,'hmmss'))

sunilkumarqv
Valued Contributor II

Re: Time format (hhmmss) shown wrong

can you try this


Time(Time#(If(len(TPROA)>5, 'hhmmss','hmmss'))) as [Time-scan-return-carton]

MVP
MVP

Re: Time format (hhmmss) shown wrong

I think sunilkumarqv‌ might have meant this...

Table:

LOAD *,

Time(Time#(TPROA, If(Len(Trim(TPROA)) = 5, 'hmmss', 'hhmmss'))) as [Time-scan-return-carton];

LOAD * Inline [

TPROA

81920

182130

];

The above seems to work

Capture.PNG

jamesehunt
New Contributor III

Re: Time format (hhmmss) shown wrong

Hi Sunil,

I like your approach, but it didn't work.

here is the sample

Anything else?

MVP
MVP

Re: Time format (hhmmss) shown wrong

Did you try this?

Table:

LOAD *,

Time(Time#(TPROA, If(Len(Trim(TPROA)) = 5, 'hmmss', 'hhmmss'))) as [Time-scan-return-carton];

LOAD * Inline [

TPROA

81920

182130

];