3 Replies Latest reply: Oct 24, 2016 1:41 AM by Sunny Talwar

# 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?

• ###### Re: paint text red if

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))

• ###### Re: paint text red if

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

• ###### Re: paint text red if

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))