Skip to main content
Announcements
Qlik Community Office Hours - Bring your Ideation questions- May 15th, 11 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem with Colors in a Bar Chart

I have problems to add some color to the bar chart. I'm placing the following expression in the "Background Color".

if (fabs ((Sum (MIX)-sum (Plan)) / Sum (MIX))> 0.25, lightred (), lightblue ())

The main expression is

fabs ((Sum (MIX)-sum (Plan)) / Sum (MIX))

and has marked the "Relative".

But it does not work properly

1 Solution

Accepted Solutions
Not applicable
Author

Sorry, but still not working

View solution in original post

8 Replies
MayilVahanan

Hi

if (fabs ((Sum (MIX)-sum (Plan)) / Sum (total MIX)) > 0.25, lightred (), lightblue ())

or

give original value for comparison, not relative value(0.25)..

hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Actually, red coloring need all bars that exceed the value of the variable VMetaMAPE.

Attached the example

swuehl
MVP
MVP

Try for the background color attribute expression:

if (fabs((Sum(MIX)-sum(Plan))/Sum(MIX)) / sum(total aggr(fabs((Sum(MIX)-sum(Plan))/Sum(MIX)),MesAño))

> VMetaMAPE, lightred (), lightblue ())

Not applicable
Author

Sorry, but still not working

MayilVahanan

Hi

PFA

Edit:

Mr.Swuehl expression works well.. Same only i used in demo application..

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

As the expression would be if in the same example, instead of using the dimension MonthYear (MesAño) use a hierarchical group of Year, Month.

Thanks

Not applicable
Author

Hi All,

 

   Mr. Mayil Vahanan Sir It is absolutely working. I Dont know why it is not working for zenigarcia.

Regards,

Nirmal.

Not applicable
Author

Sorry for not warning. If it works well only nowI have anotherrequirementis that the expression

work but whose dimension is a hierarchical group of Year and Month.