Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to display 90 mins as 1h 30m in charts

Hi All,

Need help in displaying the 90 mins as 1h 30m in charts, suppose if the data is in this way

Job Runtime

A    90 mins

B    60 mins

C    75 mins

should display as 1h, 1h 30m, 1h 45m on charts.

Thank you all

krishna

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this using Interval() in script

Interval(Runtime/60/24, 'hh:mm')

Div(Runtime, 60) & 'h '& Mod(Runtime, 60) & 'm'

Regards,

Jagan.

View solution in original post

6 Replies
Anonymous
Not applicable
Author

Try this

table1:

LOAD * INLINE [
Job, Runtime
1, 60 mins
2, 90 mins
3, 75 mins

]
;

temp:
load div(subfield(Runtime,'mins',1),60) & 'h ' & if(mod(subfield(Runtime,'mins',1),60)<> 0,mod(subfield(Runtime,'mins',1),60) & 'm') as time
resident table1;

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

If it is just these 3 values, then

     =Pick(Match(myTimeField, 60, 75, 90), '1h', '1h15', '1h30'))

Change the field to the correct name.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this using Interval() in script

Interval(Runtime/60/24, 'hh:mm')

Div(Runtime, 60) & 'h '& Mod(Runtime, 60) & 'm'

Regards,

Jagan.

Not applicable
Author

Thanks Jagan, Finally I got it. There is one more problem where Runtime is 0 mins it is displaying as 0h 0m. I just want to rename this 0h 0m as NA.  on chart while displaying MYSTUFF.PNG

Thank you all once again....

jagan
Luminary Alumni
Luminary Alumni

Hi,

Just add one if condition

If(Runtime > 0, Div(Runtime, 60) & 'h '& Mod(Runtime, 60) & 'm', 'NA')

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

Jagan, thanks once again for your prompt reply...it executed beautifully