Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
ranajit81
New Contributor III

Stacked bar chart color coding

Hi all,

I am using a stacked bar chart using 2 dimensions and 1 expression

The Dimensions are

=Left(MileStoneCategory,1)&Right(MileStoneCategory,1)

MileStoneStatus_FILTER

The Expression is

=NUM((Count(MileStoneStatus)/Count(Total {<MileStoneCategory={'Milestone1'}>} MileStoneStatus)),'##.00')

MileStoneCategory field has the values - Milestone 1, Milestone 2,Milestone 3,Milestone 4,Milestone 5,Milestone 6

MileStoneStatus field has the values which are color coded for the stacked bar chart -->

Completed (black)

Partial (blue)

Not Complete (green)

Not Met (grey)

Not Applicable (light grey)

The order of each bar must be like the above according to data.

In the Sort tab, it is sorted to the MileStoneStatus dimension by Ascending in Expression -->

=Only({1}IF(MileStoneStatus = 'Not Applicable', 1,  

IF(MileStoneStatus = 'Not Met', 2,  

IF(MileStoneStatus = 'Not Complete', 3,  

IF(MileStoneStatus = 'Partial', 4,

IF(MileStoneStatus = 'Complete', 5,

))))))

6 Replies

Re: Stacked bar chart color coding

Does the sort change based on selection?

ranajit81
New Contributor III

Re: Stacked bar chart color coding

no, the sort stays the same. Only the size of the section in the bar will change

Re: Stacked bar chart color coding

but what is the issue? Sort changing or value changing?

ranajit81
New Contributor III

Re: Stacked bar chart color coding

The issue is that the sorting of the color is changing. It is suppose to stay in the same order. Top of the bar is Not Applicable  - light grey, then grey, green, blue and bottom of the bar is Complete - Black. Like it shows in the legend

Re: Stacked bar chart color coding

Not sure if it makes a difference, but try this

=Match(Only({1} MileStoneStatus), 'Not Applicable', 'Not Met', 'Not Complete', 'Partial', 'Complete')

ranajit81
New Contributor III

Re: Stacked bar chart color coding

I tried that option. It din't make a difference. I tried using the Background Color of the field. Any ideas on that?