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: 
bhavvibudagam
Creator II
Creator II

Time Conversation

Hi, 

    Can any one help me to do.

       In An 'AHT' fleld i have multiple records like 0:05:03 , 0:04:59 so on.I have to convert this hh:mm:ss format to number.My required format is in AHT fIeld the records are like 303, 299.

         Please answer this question in scripting with dynamic expression.

Thanks,

17 Replies
bhavvibudagam
Creator II
Creator II
Author

Not working still showing 00 for 0:05:03

sunny_talwar

I see that you have 00 for hh, can you try this:

Interval(Alt(Time#(AHT, 'hh:mm:ss'), AHT/(24*3600)), 'ss')

sunny_talwar

Can you check if AHT is just a timestamp and doesn't include date component? Can you create a list box with this expression Num(AHT)

bhavvibudagam
Creator II
Creator II
Author

Hi sunny i have attached the data file.Please find it.Please upload the qvw file if it works fine.

Thanks in advance.

sunny_talwar

Try this:

Table:

LOAD QUEUE,

  DATE,

    DAY,

    AHT,

  Interval(Alt(Time#(NEW_AHT, 'h:mm:ss'), If(Num#(NEW_AHT) < 1, NEW_AHT, NEW_AHT/(24*3600))), 'ss') as NEW_AHT;

LOAD QUEUE,

    DATE,

    DAY,

    Text(AHT) as NEW_AHT,

    AHT

FROM

[DATA (7).xlsx]

(ooxml, embedded labels, table is [raw data]);


Table:

LOAD QUEUE,

  DATE,

    DAY,

    AHT,

  Interval(Alt(Time#(NEW_AHT, 'h:mm:ss'), If(Num#(NEW_AHT) < 1, Num#(NEW_AHT), Num#(NEW_AHT)/(24*3600))), 'ss') as NEW_AHT;

LOAD QUEUE,

    DATE,

    DAY,

    Text(AHT) as NEW_AHT,

    AHT

FROM

[DATA (7).xlsx]

(ooxml, embedded labels, table is [raw data]);

bhavvibudagam
Creator II
Creator II
Author

Thank you so much sunny its working

sunny_talwar

Awesome

If you got what you were looking for, I would request you to close this thread by marking correct and helpful answers.

Qlik Community Tip: Marking Replies as Correct or Helpful

Thanks and regards,

Sunny

sunny_talwar

Bhavvi‌ - Please take some time to review the link I have pasted for you. When we ask to mark the correct answer and helpful answer, we are looking for you to mark a answer which actually helped you and not marking any answer as correct.

Why is it important to mark Helpful and correct answers? People like you and me can have similar problems and might be looking on the community for a solution. If they read this discussion, we want to make sure they don't have to spend an hour going through the whole thread to find responses which actually were helpful. So if we leave the current answer as the correct answer, this is what they will see:

Capture.PNG

How useful do you think that would be for someone looking for a solution to read time correctly?

By marking the truly correct and helpful answer, we both will contribute to making this community a better place. So my friend lets do our share

Thanks and regards,

Sunny