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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
saumyashah90
Specialist
Specialist

Convert multiple hh:mm:ss into hours

For example I have time field

11:22:30

11:53:15

11:59:30

12:25:02

12:54:35

13:56:20

I should get output

3 at 11hrs

2 at 12hrs

1 at 13 hrs

8 Replies
Anonymous
Not applicable

Maybe something like this ?

Temp01 :

LOAD * INLINE [

  Time

  11:22:30

  11:53:15

  11:59:30

  12:25:02

  12:54:35

  13:56:20

];

NoConcatenate

Temp02 :

Load

  Hour(Time) as Hour ,

  *

;

Load

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

resident Temp01

;

drop table Temp01 ;

load

  Hour ,

  Count(Hour) as CountHour

resident Temp02

group by Hour

order by Hour

;

drop table Temp02 ;

saumyashah90
Specialist
Specialist
Author

Hi bill,

Thanks for the response but idon't wanna go with group by or order by....

With help of functions I can do I guess can you help me with that

HirisH_V7
Master
Master

Hi,

Temp:

LOAD * INLINE [Time,Old Time

11:22:30,11:22:30

11:53:15,11:53:15

11:59:30,11:59:30

12:25:02,12:25:02

12:54:35,12:54:35

13:56:20,13:56:20

];

Newinfo:

NoConcatenate

Load

Hour(Time) as Hour,

[Old Time]

Resident Temp;

Drop Table Temp;

Hope this Helps,

Thanks,

Hirish

HirisH
Anonymous
Not applicable

Why don't you want to use group by or order by.... ?

saumyashah90
Specialist
Specialist
Author

There are millions of rows and numerous fields along with it.... If iload whole datable again doing no concatenate will create redundancy

maxgro
MVP
MVP

maybe with a calculated dimension in a chart (str table, bar, etc..)

dimension

=Time(floor(t,1/24), 'hh')

1.png

HirisH_V7
Master
Master

Hi,

Temp:

LOAD * INLINE [Time,Old Time

11:22:30,11:22:30

11:53:15,11:53:15

11:59:30,11:59:30

12:25:02,12:25:02

12:54:35,12:54:35

13:56:20,13:56:20

];

Newinfo:

NoConcatenate

Load

Hour(Time) as Hour,

Time(Time, 'hh:mm TT') AS TimeAMPM,

Time(Time) AS Time24h,

[Old Time]

Resident Temp;


Drop Table Temp;

Hope This Helps .

Thanks,

Hirish

HirisH
Anonymous
Not applicable

Just use the count() function in the front end then.