Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to get different clored bars depending on some condition in x-axis

Hi,

i have to display quantity across time axis.i want the bar colors to change for the past and future dates.how can i do that?

Can anyone please suggest how i can do the full acuumulation/cumlation of the values in pivot chart?

Please help.

Thanks in advance.

6 Replies
Not applicable
Author

Go to Expression Tab.

Expand the expression.

Select the Background color

Add a condition if(Month<=month(today()) ,RGB(0,236,0),RGB(255,100,255))

Note: This won't work if the graph is sorted according to y value.

Not applicable
Author

Thanks.

Sorry i was not clear in asking my question.I am getting the colored bars depending on time.I have 2 stacks to show one of which consists actualquantity+futurequantity.can i get legends in differnt colors.Like i am having 2 stacks one for budget quantity and other which displays actual or plan.SO how can i get 3 colored legends for 2 stacks.

Not applicable
Author

Are you looking for something like this

Not applicable
Author

yes exactly.But i a showing it in grouped style.Can u please let me know how to do that.

Not applicable
Author

In the last method, i had used three expressions.

1. Budgeted: sum(BudgetAmount)

2. Actual : if(Month<=month(today()),sum(ActualAmount),0)

3. Planned: if(Month>month(today()),sum(PlannedAmount),0)

Suppress the 0 values, so that it won't be shown in chart.

But when you show it as grouped a blank space may appear between planned and budgeted bars

Or else you can use the first method I suggested. It will give you the correct result. Only problem there is that, in legends it will display only two color, eventhough chart will have all three. So in legen you will have to mention like Actual/Planned together

Not applicable
Author

Thank you very much