Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

joeybird
Contributor II

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

Re: top time figures in bar chart - qlik sense

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.

5 Replies

Re: top time figures in bar chart - qlik sense

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
Contributor II

Re: top time figures in bar chart - qlik sense

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

Re: top time figures in bar chart - qlik sense

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
Contributor II

Re: top time figures in bar chart - qlik sense

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
Contributor II

Re: top time figures in bar chart - qlik sense

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