Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
joeybird
Creator III
Creator III

top time figures in bar chart - qlik sense

Hiya

I have a bar chart, which is showing time values....

i want to sort from largest time to shortest time ...however when i sort numerically, this function does not work

this could be because i am converting figures e.g 37.5 to time 37.30.00

is there a sort expression that can be used to help with this issue?

Kind Regards

Joeybird 


1 Solution

Accepted Solutions
rubenmarin

Maybe you can change that:

div(Sum([Department]), 1) & ':' & div(((Sum([Department]) - div(Sum([Department]), 1)) *60),1)

to this:

=Interval(Sum([Department])/24, 'hh:mm:ss')

Just to comment, time has a limit of 24 hours, Interval doesn't have that limit.

View solution in original post

5 Replies
rubenmarin

Hi Joanna, if 37.30.00 is a string it won't sort right.

You can use Interval to keep as number:

=Interval(37.5/24, 'hh.mm.ss') //Divided for the number of hours in a day

joeybird
Creator III
Creator III
Author

problem i got is i am converting the figure

time has been entered as e.g 37.5, which i have to convert to time.

as e.g

div(Sum([Department]), 1) & ':' & div(((Sum([Department]) - div(Sum([Department]), 1)) *60),1)

is there a way to format it?

Kind Regards

joeybird

rubenmarin

Maybe you can change that:

div(Sum([Department]), 1) & ':' & div(((Sum([Department]) - div(Sum([Department]), 1)) *60),1)

to this:

=Interval(Sum([Department])/24, 'hh:mm:ss')

Just to comment, time has a limit of 24 hours, Interval doesn't have that limit.

joeybird
Creator III
Creator III
Author

Hiya

this calculation does work

=Interval(Sum([Department])/24, 'hh:mm:ss')

...however it still wont let me sort numerically, so I can show bar chart, highest to lowest values.

please help

Kind Regards

joeybird
Creator III
Creator III
Author

Hiya

sorted , just moved the sorting order around and it worked x

it still however needed your format of calculation to work

=Interval(Sum([Department])/24, 'hh:mm:ss'),

Kind Regards

Joeybird