Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Change the colour of a bar based on rank of dimension

Hi All

I want to calculate the rank of dimension and assign colour to the dimension based on dimension rank

is it possible

15 Replies
el_aprendiz111
Specialist
Specialist

Hi,

1 example:

Dimensions / Background color

=If(Aggr(Rank(Sum(VALUE)), MONTH)<=3, LightBlue(), LightGreen())

marjan_it
Creator III
Creator III

Hi

this can help you:

=if(rank((Num(((sum(Feild))),'#,##0.0')))<=3,rgb(255,0,0),rgb(255,130,0))

Not applicable
Author

Hi

Im showing top 5 values in the chart now i want different colours for different  bars how can i do it

tresesco
MVP
MVP

Chart-> Right click-Properties->Color tab, check 'Multicolored' to enable. If you want the colors to be persistent check 'Persistent' as well. You can choose your colors for bars from the data appearance pallet too.

Capture.PNG

Not applicable
Author

Hi try this

=If(Aggr(Rank(Sum(VALUE)), MONTH)=1, Green(),

     If(Aggr(Rank(Sum(VALUE)), MONTH)=2, Red(),

          If(Aggr(Rank(Sum(VALUE)), MONTH)=3,Yellow(),

               If(Aggr(Rank(Sum(VALUE)), MONTH)=4, Blue(),

                    If(Aggr(Rank(Sum(VALUE)), MONTH)=5, Cyan())))))


Not applicable
Author

Hi tresesco im using two expressions and 2 dimensions in bar chart so multi coloured option is disabled

Not applicable
Author

Hi reddy your code gives different colour for different  months what i want is if china is green in colur in one month the same china should be green in colour in another month

tresesco
MVP
MVP

Then try background color expression : Color(RowNo()), like

Capture.PNG

Not applicable
Author

Will this give me the below result

If in jan 2016 usa is red in colour

In feb 2016 ysa should be red