Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
brunopaulo
Partner - Creator II
Partner - Creator II

Bar Chart color based on rank

Hi community,

I'm creating a bar chart where i want to show the top sellers.

I have this expression: Sum({$<DateType={'Prod'}>}Sales) and this give me the values i want.

Then i sorted from best seller in top (vertical bar chart) to worst seller in top. But i only show the top 10 records. This top 10 change along with the selections of user.

What i want to do with the color is use a gradient value from dark to light, where dark represents the top seller and the ligth represent the last place from this 10.

I cant find any expression in order to ignore all values and only use the gradient colors on the top 10.

At the moment i use this expression on background color of expression.

(Count(TOTAL Distinct Store)-Rank(-Sum({$<DateType={'Prod'}>}Sales)))/Count(TOTAL DISTINCT Store)

, White() , Blue())

Anyone can help me?

Thanks in advance.
Best Regards

Bruno Paulo

3 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Check if this works for you.

Using ColorMix In Qlikview

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
vardhancse
Specialist III
Specialist III

Hi Try,

=If(Aggr(Rank(Sum(Sales),4),<Dim>)<=10,<Dim>)

4 indicates

Value

Description

0 (default)

If all ranks within the sharing group fall on the low side of the middle value of the entire ranking, all rows get the lowest rank within the sharing group.

If all ranks within the sharing group fall on the high side of the middle value of the entire ranking, all rows get the highest rank within the sharing group.

If ranks within the sharing group span over the middle value of the entire ranking, all rows get the value corresponding to the average of the top and bottom ranking in the entire column segment.

1

Lowest rank on all rows.

2

Average rank on all rows.

3

Highest rank on all rows.

4

Lowest rank on first row, then incremented by one for each row.

brunopaulo
Partner - Creator II
Partner - Creator II
Author

Yes I tried to use colormix but when the values ​​were very disparate (for example the 1st and 2nd place very highlighted, the gradient was too intense) and I didn't like the tonality of the colors. I was looking for something more subtle but perceptible