Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
wossenhh
Creator
Creator

Showing Top 5 and Bottom 5 on Bar Chart

Hi,

Can anyone please help me with the following? I was trying to reflect, the Top and the Bottom five for the following data's, however QV doesn't show the bottom five's correctly as it has shown on the attachment. The data's are

NameValue
R32
D11
J9
Y8
B8
C6
X5
L4
F3
N3
A2
G2
K1
E0
H0
I0
M0
P0

The top 5 in Green color are correct which are R - D - J - Y - B, but the bottom 5 in Red color shows only three as A - G - K in stead of showing 5 of them as  F - N - A - G - K. Any help please?

Thanks,

Wossen

10 Replies
MK_QSL
MVP
MVP

Presentation tab

Untick suppress Zero value

swuehl
MVP
MVP

F and N are ranked 9 and 10, but your expressions exclude ranks from 6 to 10, right?

wossenhh
Creator
Creator
Author

Yes, that is exactly what happened Swuehl!

wossenhh
Creator
Creator
Author

Hi Manish,

If I do that, I only display the bottom 5 which have zero values, which I don't want that.

swuehl
MVP
MVP

One issue is that you need / want  to exclude the employees with zero hours from the ranking, right?

So maybe like attached (there is probably an easier solution, it's just too late for me today).

Not applicable

try this expression

If (Rank(Sum([Utilized hours])) >= (count(total DISTINCT Employee)-5) or Rank(Sum([Utilized hours])) <=5, Sum([Utilized hours])+1)

i added one to your sum since it doesn't display Zeros in bar chart.

anlonghi2
Creator II
Creator II

Hi Wosse, try with this:

if(num(Rank(Sum([Utilized hours]),3))<=5 or num(Rank(Sum([Utilized hours]),3))>= 10, Sum([Utilized hours]),null())

you have to check "Suppress zero value" from Presentation tab.

Best regards Andrea

wossenhh
Creator
Creator
Author

Thanks Andrea and you nailed it! Have a wonderful weekend!

Wossen

wossenhh
Creator
Creator
Author

Thanks v4Shankar for your effort, but it still shows me the zero's value at the bar chart. Andrea and Swuel come up with the correct expression formula that give me exactly what I want!

Regards,

Wossen