Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
wossenhh
Contributor

Top 5 and Bottom 5 bar chart in color

Hi,

I was trying to create a bar chart that displays the top 5 employee in Green and the bottom 5 employee in Red color in one chart. I have one dimension (Employee) and the expression is the utilized hours that used by employee in percentage. Can anybody please tell me how to do it?

I was using the following in expression Background color:

'If (Rank(Sum(vTotalUtilization)) <6, Green(), if (Rank(Sum(vTotalUtilization)) > 5, Red())), but it turns out every bar's in Red color.

Please help.

Thanks

Tags (2)
14 Replies
Highlighted
Employee
Employee

Re: Top 5 and Bottom 5 bar chart in color

Hi Wossen,

Your expression is fine if you use the field with the utilized hours (see example attached).

I hope it helps.

Carlos

Highlighted
wossenhh
Contributor

Re: Top 5 and Bottom 5 bar chart in color

Hi Carlos,

Thanks for your quick reply. The problem I have from this expression when I sorted by Y-value in Descending order, I could able to see the top 5, but the bottom 5 bars are not accurate. For example if I have 15 values and want to show the top 5 and bottom 5 values after enabling the X-Axis Scrollbar, I have to move the scroll bar to the right to see the lowest value. Is there any other way to tackle this?

Thanks,

Wossen

Highlighted
Employee
Employee

Re: Re: Top 5 and Bottom 5 bar chart in color

Hi Wossen,

You can choose to show only the top 5 and the bottom 5 as in the example.

I hope it helps.

Carlos

Highlighted
wossenhh
Contributor

Re: Top 5 and Bottom 5 bar chart in color

Hi Carlos,

Yes, this does help and thanks so much! One more thing though, I know how to add a reference line on a chart to show the targets or goals. But I don't know how to add a range, for example from your example, how to show a target utilization range hours that highlighted between 15-20?

Thanks,

Wossen

Highlighted
Employee
Employee

Re: Top 5 and Bottom 5 bar chart in color

Hi Wossen,

You can use two reference lines to show the range. If this is not what you mean, please provide a picture because I am not sure I understand what you are  trying to obtain.

Carlos

Highlighted
Not applicable

Re: Top 5 and Bottom 5 bar chart in color

Hi,

Regards.

Highlighted
wossenhh
Contributor

Re: Top 5 and Bottom 5 bar chart in color

Hi Carlos,

Yeah, I can use two reference lines as you stated, but I want to display one solid line between 15 and 20. I don't know if that could possible.

I really appreciate for your help Carlos!

Thanks,

Wossen

Highlighted
wossenhh
Contributor

Re: Top 5 and Bottom 5 bar chart in color

Thanks Ernesto.

Highlighted
Employee
Employee

Re: Re: Top 5 and Bottom 5 bar chart in color

Hi Wossen,

You can try to put a text object or a line object on top as in the attched example.

Carlos