Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

paint text red if

I want to paint a table red and bold if they reach 1/12 percent difference.

=if(Sum({1<OrderYearMonth = {$(selectedYearMonth)}>}LineTotal)/Sum({1<OrderYearMonth = {$(YearSelected)}, OrderYearMonth>}LineTotal) - 1) < 8.3, RGB(255, 128, 128))

It says me that the last part of my script is not right. What could it be there?

thanks in advance

3 Replies
sunny_talwar

Are these two expressions working and giving correct values?

Sum({1<OrderYearMonth = {$(selectedYearMonth)}>}LineTotal)

Sum({1<OrderYearMonth = {$(YearSelected)}, OrderYearMonth>}LineTotal)

If it is, try this:

=If(Sum({1<OrderYearMonth = {$(selectedYearMonth)}>}LineTotal)/Sum({1<OrderYearMonth = {$(YearSelected)}, OrderYearMonth>}LineTotal) - 1) < 0.083, RGB(255, 128, 128))

Not applicable
Author

Those formules give correct values.

=If(Sum({1<OrderYearMonth = {$(selectedYearMonth)}>}LineTotal)/Sum({1<OrderYearMonth = {$(YearSelected)}, OrderYearMonth>}LineTotal) - 1) < 0.083, RGB(255, 128, 128))

this value gives error in this section:

=If(Sum({1<OrderYearMonth = {$(selectedYearMonth)}>}LineTotal)/Sum({1<OrderYearMonth = {$(YearSelected)}, OrderYearMonth>}LineTotal) - 1) < 0.083, RGB(255, 128, 128))



It gives me error in the expression in the place as in my previous formule.

How can this be resolved?

In the attachment you can find a printscreen and the doc.


Merci

sunny_talwar

I think you have these extra parenthesis here:

=If(Sum({1<OrderYearMonth = {$(selectedYearMonth)}>}LineTotal)/Sum({1<OrderYearMonth = {$(YearSelected)}, OrderYearMonth>}LineTotal) - 1) < 0.083, RGB(255, 128, 128))

Once you remove this, you should be fine

=If(Sum({1<OrderYearMonth = {$(selectedYearMonth)}>}LineTotal)/Sum({1<OrderYearMonth = {$(YearSelected)}, OrderYearMonth>}LineTotal) - 1 < 0.083, RGB(255, 128, 128))

=If(Sum({1<OrderYearMonth = {$(selectedYearMonth)}>}LineTotal)/Sum({1<OrderYearMonth = {$(YearSelected)}, OrderYearMonth>}LineTotal) - 1 < 0.083, RGB(255, 128, 128))