Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Time format

Hi QV team,

These are actual dates.

0

400

450

600

645

730

1000

1200

1230

I require above dates like this.

00:00

04:00

04:50

06:00

06:45

07:30

10:00

12:00

12:30

Thanks,

Krish

1 Solution

Accepted Solutions
PrashantSangle

Hi,

add nested if() in provided solution.

IF(LEN(TEST_TIME)=3,TIME(Time#(TEST_TIME,'hmm'),'hh:mm'),if(LEN(TEST_TIME)=4,TIME(Time#(TEST_TIME,'hhmm'),'hh:mm'),TIME(Time#(TEST_TIME,'m'),'hh:mm')))

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

14 Replies
PrashantSangle

Hi,

Use Time(alt(Time#(FieldName,'mss'),(Time#(FieldName,'mmss')),'mm:ss')

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
sunny_talwar

Are these Hours and Minutes or Minutes and Seconds??

Best,

Sunny

Not applicable
Author

Hi,

These are Hours and Minutes.

I did use this but it not work.

Time(Alt(Time#(Time,'hmm'),Time#(Time,'hhmm')),'hh:mm')  as  time

It is showing like this.

       

Untitled.png

PrashantSangle

Hi,

What do you mean by it not work???

Which value you are getting wrong??

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

Hi Max,

This values are came correct.

400

450

600

645

730

These are not came correct.

1000

1200

1230

PrashantSangle

Hi,

Well then try below

IF(LEN(TEST_TIME)=3,TIME(Time#(TEST_TIME,'hmm'),'hh:mm'),TIME(Time#(TEST_TIME,'hhmm'),'hh:mm'))

It will work for you

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
sunilkumarqv
Specialist II
Specialist II

Time(Timestamp(

Alt(

  Timestamp#([DateField],'DD/MM/YYYY hh:mm[:ss]'),

  Timestamp#([DateField],'DD-MM-YYYY hh:mm[:ss]')

  )

,'DD/MM/YYYY hh:mm'),'hh:mm') as Time

Not applicable
Author

Hi Sunil,

I am getting same problem.

PrashantSangle

Hi,

did try my new suggestion.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂